pub fn parse(source: &str) -> Vec<RichEvent>Expand description
Parse source as marquee-flavoured markdown and produce a
RichEvent stream ready for layout.
Infallible: every input is a document. See the module docs for how malformed spans and fences degrade.
The parser runs in two passes:
- Div pre-pass — scan lines for
:::classopen fences and bare:::close fences. Split the source into a sequence of text chunks separated by syntheticDivStart/DivEndevents. Each text chunk is a self-contained markdown block; a paragraph or list cannot span a div boundary. - Chunk pass — feed each text chunk through pulldown-cmark
(with strikethrough, sup, sub, and math extensions enabled) and
layer on the
{selector body}inline-span post-pass.