validate_tree : Parsed, Props -> Try(Parsed, [InvalidMarkup(Error)])
Validate all names, attribute values and child models in a supplied tree. Unavailable template values can only be skipped by internal slot parsing.
Markup :: # (opaque)
Shared markup identities, source trees, contexts and templates.
validate_tree : Parsed, Props -> Try(Parsed, [InvalidMarkup(Error)])
Validate all names, attribute values and child models in a supplied tree. Unavailable template values can only be skipped by internal slot parsing.
parse_xml : _
whitespace : _
element_names : Namespace -> List(Str)
Canonical element spellings for a built-in namespace.
Markup.Context :: # (opaque)
from_parent : Props -> Try(Context, [InvalidPlacement(Diagnostic(Problem))])
Validate decoded text against the parent's content model.
:= { parent : Name, attributes : List(Attribute) ?? [], syntax : Syntax ?? HtmlSyntax, scripting : [Enabled, Disabled] ?? Enabled }
Validate a parent identity and seed its authoring context.
:= { name : Name, attributes : List(Attribute) ?? [] }
Validate a child without changing the reusable parent context.
Markup.Template :: # (opaque)
ContextProblem : Problem
:= { parent : Name, attributes : List(Attribute) ?? [], syntax : Syntax ?? HtmlSyntax, scripting : [Enabled, Disabled] ?? Enabled }
Validate a parent identity and seed its authoring context.
:= { name : Name, attributes : List(Attribute) ?? [] }
Validate a child without changing the reusable parent context.
Syntax : Syntax
Span : Span
Token : Token
:= { bytes : List(U8), tokens : List(Token) }
Lossless bytes and a partition into lexical regions.
is_eq : _
Compare the retained source and lexical ranges.
to_hash : _
Hash the retained source and lexical ranges.
from_bytes : List(U8) -> Source
Retain arbitrary bytes, including malformed UTF-8 and incomplete tags.
from_tokens : List(U8), List(Token) -> Source
Retain token regions produced by a syntax-specific parser. Regions must partition the supplied bytes; partition_valid checks this invariant.
partition_valid : Source -> Bool
Whether token ranges cover every byte once, in order, without empty regions. An empty input has an empty token list.
Retain UTF-8 source without normalization.
The exact bytes of a source token.
Locate a byte offset using the common one-based UTF-8 position convention.
ValueGrammar : ValueGrammar
ValueLanguage : ValueLanguage
StructureReason : StructureReason
ChildGrammar : ChildGrammar
UnsupportedReason : UnsupportedReason
ActualRoot : ActualRoot
Resource : Resource
InterpolationProblem : InterpolationProblem
Problem : Problem
Error : Error
:= { syntax : Syntax ?? XmlSyntax, exact_structure : Bool ?? False, strict_foreign_spelling : Bool ?? False, allow_unknown_elements : Bool ?? False, allow_unknown_attributes : Bool ?? False, check_values : Bool ?? True, max_source_bytes : U64 ?? 16_777_216, max_depth : U64 ?? 1024, max_elements : U64 ?? 4_194_304, max_nodes : U64 ?? 4_194_304, max_slots : U64 ?? 65_536, max_attributes : U64 ?? 1024, recovery : [Strict, Browser] ?? Strict, max_diagnostics : U64 ?? 1024, max_work_per_byte : U64 ?? 256 }
Configurable validation and resource limits, strict by default. exact_structure rejects repaired HTML nesting before derived projection. strict_foreign_spelling requires authored SVG/MathML names to match their canonical DOM spelling in HTML syntax, including closing tags. XML work counts deterministic source-byte traversals and reader events; it is a progress ceiling rather than a count of machine instructions.
Markup.InitialNewlineState :: # (opaque)
One-token HTML initial-line-feed state, created from an element's text behavior.
is_eq : _
to_hash : _
from_behavior : [DropInitialLf, PreserveInitialLf] -> InitialNewlineState
is_pending : InitialNewlineState -> Bool
step : InitialNewlineState, Token -> { state : InitialNewlineState, token : Token, action : [Skipped, Preserved] }
Empty character bindings preserve pending state; any other token consumes it.
InitialNewlineToken : Token
:= { namespace : Namespace, local : Str, prefix : [Prefix(Str), Unprefixed] }
Explicit expanded identity shared by XML and markup; no vocabulary validity is implied.
is_eq : _
to_hash : _
from_qualified : QualifiedProps -> Try(Name, [InvalidDomName(Diagnostic(Problem))])
Validate a computed DOM spelling and retain its explicit namespace identity.
Format the explicitly supplied prefix; a colon in local remains literal.
is_known_element : Name -> Bool
is_custom_element : Name -> Bool
is_known_attribute : Name, AttributeProps -> Bool
is_aria_attribute : Name -> Bool
is_boolean_attribute : Name, AttributeProps -> Bool
attribute_grammar : Name, AttributeProps -> ValueGrammar
enumerated_values : Name, AttributeProps -> Try(List(Str), [NotEnumerated])
is_void_element : Name -> Bool
text_behavior : Name, TextProps -> TextBehavior
drops_initial_newline : Name -> Bool
initial_newline : Name -> InitialNewlineState
Seed the serializer's first-token line-feed rule from this name.
is_event_handler : Name, AttributeProps -> Bool
Context : [Element, Attribute]
:= { namespace : Namespace, spelling : Str, context : Context }
:= { attribute : Name }
:= { scripting : [Enabled, Disabled] ?? Enabled }
:= { namespace : Namespace, spelling : Str, context : Context }
:= { attribute : Name }
:= { scripting : [Enabled, Disabled] ?? Enabled }
Attribute : Attribute
Origin : Origin
Node : Node
:= { nodes : List(Node), roots : List(U64) }
Indexed nodes with document/fragment roots in authored order.
Parsed : Parsed