Skip to main content

Module html

Module html 

Expand description

Borrowed-AST HTML rendering.

Consumes a BorrowedLexOutput directly and emits semantic HTML5.

§Algorithm

Single forward match_indices sweep over the lexer’s normalized text, capturing every PUA sentinel + \n in O(n). Plain text between matches flows through the bulk-copy escape pass; sentinels dispatch into crate::render_node::render via the borrowed registry’s EytzingerMap::get lookup.

Block structure mirrors the legacy walker: a two-state machine RenderState::ensure_in_paragraph / RenderState::close_paragraph emits <p> / </p> symmetrically; standalone block nodes (and container open/close events) flush the current paragraph first.

Functions§

render_into
Render a BorrowedLexOutput into the given writer.
render_to_string
Render a BorrowedLexOutput into a fresh String.