ParseResult is returned by the parse() and parseIncremental() methods of MarkdownParser. It contains the structured AST representation of the markdown document along with any extracted mathematical expressions.
Structure
Fields
Array of root-level block nodes representing the parsed document structure. Each element is a
MarkdownBlockNode enum case such as .paragraph, .heading, .codeBlock, etc.The document array contains only top-level blocks. Nested blocks (like paragraphs inside a blockquote) are contained within their parent’s structure.Dictionary mapping math replacement identifiers to their original LaTeX content.When the parser encounters inline or block math expressions (like
$E = mc^2$ or $$...$$), it:- Extracts the LaTeX content
- Assigns it a unique integer identifier
- Replaces it with a placeholder in the AST
- Stores the mapping in
mathContext
Usage
Basic Parsing
Working with Math Context
Incremental Parsing
Related Types
- MarkdownParser - The parser class that produces ParseResult
- MarkdownBlockNode - Block-level AST nodes in the document
- MarkdownInlineNode - Inline-level AST nodes within blocks