OCaml HTML5 parser/serialiser based on Python's JustHTML
at main 1.0 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: MIT 4 ---------------------------------------------------------------------------*) 5 6(** Bridge between Html5rw parse errors and validation messages. 7 8 This module converts parse errors from the Html5rw parser into 9 standardized validation messages. *) 10 11(** Convert a parse error to a validation message. 12 13 Extracts error code, line, column, and creates a Message.t with 14 severity set to Error. 15 16 @param system_id Optional file path or URL to include in location *) 17val of_parse_error : ?system_id:string -> Html5rw.parse_error -> Message.t 18 19(** Collect all parse errors from a parse result. 20 21 Extracts all parse errors from the Html5rw.t result and converts 22 them to validation messages. 23 24 @param system_id Optional file path or URL to include in locations *) 25val collect_parse_errors : ?system_id:string -> Html5rw.t -> Message.t list