···66(** Valid email address validator.
7788 Validates a single email address. Uses simplified validation rules:
99- - Must contain exactly one '@' character
1010- - Local part (before @) must be non-empty
1111- - Domain part (after @) must be non-empty and contain at least one '.'
99+ - Must contain exactly one ['@'] character
1010+ - Local part (before ['@']) must be non-empty
1111+ - Domain part (after ['@']) must be non-empty and contain at least one ['.']
1212 - Only ASCII characters allowed *)
1313module Email : Datatype.S
1414
+1-1
lib/check/datatype/dt_media_query.mli
···8899(** Media query validator.
10101111- Validates CSS media queries used in media attributes and CSS @media rules.
1111+ Validates CSS media queries used in media attributes and CSS [@@media] rules.
12121313 Examples:
1414 - "screen"
+3-3
lib/check/element/element.mli
···45454646(** A typed HTML element.
47474848- @field tag The element's tag classification
4949- @field attrs Typed attributes parsed from raw input
5050- @field raw_attrs Original attribute name-value pairs for fallback *)
4848+ - [tag]: The element's tag classification
4949+ - [attrs]: Typed attributes parsed from raw input
5050+ - [raw_attrs]: Original attribute name-value pairs for fallback *)
5151type t = {
5252 tag : Tag.element_tag;
5353 attrs : Attr.t list;
+7-7
lib/check/htmlrw_check.mli
···21212222 {2 Handling Specific Errors}
23232424- Use pattern matching on {!field-message.error_code} for fine-grained control:
2424+ Use pattern matching on [error_code] for fine-grained control:
25252626 {[
2727 List.iter (fun msg ->
···188188189189(** Human-readable text format.
190190191191- {v
191191+{v
192192file.html:5.3: error [missing-alt]: Element "img" is missing required attribute "alt".
193193- v} *)
193193+v} *)
194194val to_text : t -> string
195195196196(** JSON format compatible with Nu HTML Validator.
197197198198- {v
198198+{v
199199{"messages":[{"type":"error","message":"...","firstLine":5,"firstColumn":3}]}
200200- v} *)
200200+v} *)
201201val to_json : t -> string
202202203203(** GNU error format for IDE integration.
204204205205- {v
205205+{v
206206file.html:5:3: error: Element "img" is missing required attribute "alt".
207207- v} *)
207207+v} *)
208208val to_gnu : t -> string
209209210210
+10-4
lib/check/specialized/title_checker.ml
···11(** Title element validation checker. *)
2233type state = {
44+ mutable seen_html : bool; (* true if we've seen html element (full document mode) *)
45 mutable in_head : bool;
56 mutable head_had_children : bool; (* true if head contained any child elements *)
67 mutable has_title : bool;
···1011}
11121213let create () = {
1414+ seen_html = false;
1315 in_head = false;
1416 head_had_children = false;
1517 has_title = false;
···1921}
20222123let reset state =
2424+ state.seen_html <- false;
2225 state.in_head <- false;
2326 state.head_had_children <- false;
2427 state.has_title <- false;
···28312932let start_element state ~element _collector =
3033 (match element.Element.tag with
3131- | Tag.Html `Html -> ()
3434+ | Tag.Html `Html ->
3535+ state.seen_html <- true
3236 | Tag.Html `Head ->
3337 state.in_head <- true;
3438 state.head_had_children <- false
···5559 (`Element (`Must_not_be_empty (`Elem "title")));
5660 state.in_title <- false
5761 | Tag.Html `Head ->
5858- (* Only report missing title if head had children (was explicit with content).
5959- An empty head was likely implicit (fragment validation from body). *)
6060- if state.in_head && not state.has_title && state.head_had_children then
6262+ (* Report missing title if:
6363+ - We saw an html element (full document mode), OR
6464+ - Head had explicit children (was not just an implicit empty head)
6565+ An empty head without html element was likely implicit (fragment validation). *)
6666+ if state.in_head && not state.has_title && (state.seen_html || state.head_had_children) then
6167 Message_collector.add_typed collector
6268 (`Element (`Missing_child (`Parent "head", `Child "title")));
6369 state.in_head <- false
+4-4
lib/html5rw/parser/parser.mli
···359359(** Result of parsing an HTML document or fragment.
360360361361 This opaque type contains:
362362- - The DOM tree (access via {!root})
363363- - Parse errors if collection was enabled (access via {!errors})
364364- - Detected encoding for byte input (access via {!encoding})
362362+ - The DOM tree (access via {!val:root})
363363+ - Parse errors if collection was enabled (access via {!val:errors})
364364+ - Detected encoding for byte input (access via {!val:encoding})
365365*)
366366type t
367367···416416 3. {b Transport hint}: Use [transport_encoding] if provided
417417 4. {b Fallback}: Use UTF-8
418418419419- The detected encoding is stored in the result (access via {!encoding}).
419419+ The detected encoding is stored in the result (access via {!val:encoding}).
420420421421 {b Prescan details:}
422422
+3-2
lib/js/htmlrw_js.mli
···4747(** Validate an HTML string.
48484949 This is the simplest form of validation. Since there's no source element,
5050- the returned {!browser_message}s will not have element references.
5050+ the returned messages will not have element references.
51515252 {[
5353 let result = validate_string "<html><body><img></body></html>" in
···8383 descendants are annotated with data attributes, classes, and optionally
8484 tooltips based on the validation results.
85858686- @param config Annotation configuration. Defaults to {!default_annotation_config}. *)
8686+ @param config Annotation configuration. Defaults to
8787+ [Htmlrw_js_types.default_annotation_config]. *)
8788val validate_and_annotate :
8889 ?config:annotation_config -> Brr.El.t -> result
8990