Skip to main content

Module mathpass

Module mathpass 

Source
Expand description

AST pass that replaces comrak math nodes with build-time KaTeX HTML.

Runs in render_docs after the wikilink pass and before format_ast. Each NodeValue::Math becomes a NodeValue::HtmlInline holding the rendered KaTeX markup (raw HTML is allowed through because comrak_options().render .unsafe = true). Display math keeps KaTeX’s own block-level <span class="katex-display"> wrapper, so layout stays correct even though the carrier node is inline.

Functions§

transform_math
Replace every math node in the tree with its build-time KaTeX HTML.