Skip to main content

Module parser

Module parser 

Source

Structs§

ParseOptions
Dialect knobs that change parse behavior between strict CommonMark and MDX. Default is MDX-friendly so capital JSX components round-trip as JsxElement nodes; spec runners can flip cm_strict_html_blocks to treat capital lowercase tags as CM 4.6 type-7 raw HTML.
Parser
Token-stream cursor + diagnostic engine. 'tokens ties borrowed lexemes to the source; 'eng ties the engine borrow to the caller.

Functions§

parse
Lex + parse source in one shot, dropping all diagnostics. Convenience for tests + the parse bin; production callers should construct their own DiagnosticEngine.
parse_inline_str
Lex s and run the inline parser on it. Returns the inline Node list (Text, InlineCode, Bold, Italic, Strikethrough, Link, …). Used by table cells, which receive raw cell strings rather than pre-tokenised inline content.
parse_with
parse variant with explicit ParseOptions. Used by the CM spec runner to opt into CM-strict HTML block detection.