OCaml HTML5 parser/serialiser based on Python's JustHTML
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
3 SPDX-License-Identifier: MIT
4 ---------------------------------------------------------------------------*)
5
6(** Ruby element content model validation checker.
7
8 This checker validates that [<ruby>] elements follow the HTML5
9 content model requirements. Ruby annotations are used for East Asian
10 typography to show pronunciation or meaning of characters.
11
12 {2 Content Model}
13
14 A [<ruby>] element must contain:
15 - Phrasing content (the base text)
16 - One or more [<rt>] elements (the ruby text/annotation)
17 - Optional [<rp>] elements (fallback parentheses)
18
19 {2 Validation Rules}
20
21 - [<ruby>] must contain at least one [<rt>] element
22 - There should be phrasing content before the first [<rt>]
23 - [<rp>] elements should surround [<rt>] for fallback rendering
24 - Nested [<ruby>] elements are handled correctly
25
26 {2 Error Messages}
27
28 - Ruby element without any [<rt>] child
29 - Missing base text before ruby annotation
30
31 @see <https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-ruby-element>
32 HTML Standard: The ruby element
33*)
34
35val checker : Checker.t
36(** The ruby element content model checker instance. *)