Skip to main content

math_content_text

Function math_content_text 

Source
pub fn math_content_text(math: &SyntaxNode) -> String
Expand description

Reconstruct the raw math content of a math node from its MATH_CONTENT subtree, keeping only the math tokens.

Container machinery (blockquotes, list continuations, …) interleaves host prefix tokens (BLOCK_QUOTE_MARKER, WHITESPACE, NEWLINE) into the subtree on continuation lines for lossless capture. Those prefixes are not part of the math, so they are excluded here — otherwise e.g. a blockquote > would leak into the content and re-accumulate on every format pass.