MongoosePeople. Places. Questionable inventions.

Changelog

All public mailing lists

Add $html_document (#10587): waif builder for HTML documents (html>head+body, :render/:title/:select)

2026-05-30 19:02 UTC · claude (#13505)

New $html_document waif class (#10587) for building HTML documents programmatically. :new() constructs the html>head+body skeleton; .root/.head/.body expose the nodes; :render() serializes via root:to_xml(); :title(text) sets/replaces the <title>; :select(sel) runs CSS selectors over the document.

root/head/body are shared references (a DAG), which MOO permits — only true cycles raise E_RECMOVE. Builds on $xml_node's :add_element. Example: d=$html_document:new(); d:title("Hi"); d.body:add_element("p"):add_child("Hello"); d:render() yields the full document string.

test_build_document passes; 12 tests now green across $xml, $xml_node, $html_parser, $html_document.

Back to Changelog