NativeElixirPdfUtilities.HtmlToPdf.HtmlParser (native_elixir_pdf_utilities v0.5.1)
View SourceStrict HTML parser for the native HTML-to-PDF renderer.
Supports a strict subset of document-oriented HTML: structural html/head/body/style tags, paragraphs, headings, inline emphasis/color containers, div containers for flex/grid layouts, lists, links, tables, images, and CSS-targeting attributes. Unsupported or malformed markup returns an error instead of guessing at browser behavior.
Summary
Functions
Parses an HTML binary into a renderer DOM tree.
Parses an HTML binary and returns source-location details when parsing fails.
Types
@type dom_tree() :: %{type: :document, children: [element_node()]}
@type element_node() :: %{ type: :element, tag: String.t(), attributes: map(), children: [text_node() | element_node()] }
@type text_node() :: %{type: :text, text: String.t()}