Skip to main content

Module mathml

Module mathml 

Source
Expand description

Node-tree → MathML Core serializer.

Deterministic: attribute order is fixed per element, every element has an explicit close tag (no self-closing form), and text/attr values are XML escaped. The walk never panics; a hostile or fragment tree still yields a well-formed fragment.

Functions§

mathml_well_formed
Std-only well-formedness check: balanced tags, quoted attributes, escaped text. Accepts the serializer’s output contract (no self-closing tags).
to_mathml
Serialize node as a complete <math>…</math> fragment.
to_mathml_element
Serialize node as a MathML element (no outer <math> wrapper).