OCaml HTML5 parser/serialiser based on Python's JustHTML
1(** HTML5 element specifications.
2
3 Defines the complete specification for an HTML5 element including content
4 model, categories, and attributes. *)
5
6type t = {
7 name : string;
8 void : bool; (** Is void element? *)
9 categories : Content_category.t list; (** What categories it belongs to *)
10 content_model : Content_model.t; (** What children are allowed *)
11 permitted_parents : string list option; (** Explicit parent restrictions *)
12 prohibited_ancestors : string list; (** Cannot appear inside these *)
13 tag_omission : bool; (** Can end tag be omitted? *)
14 attrs : Attr_spec.t list; (** Element-specific attributes *)
15 implicit_aria_role : string option; (** Default ARIA role *)
16}
17
18val make :
19 name:string ->
20 ?void:bool ->
21 ?categories:Content_category.t list ->
22 ?content_model:Content_model.t ->
23 ?permitted_parents:string list ->
24 ?prohibited_ancestors:string list ->
25 ?tag_omission:bool ->
26 ?attrs:Attr_spec.t list ->
27 ?implicit_aria_role:string ->
28 unit ->
29 t
30
31val is_void : t -> bool
32
33val has_category : t -> Content_category.t -> bool
34
35val pp : Format.formatter -> t -> unit