Skip to main content

Module parser

Module parser 

Source
Expand description

Pulldown-cmark → typed AST parser.

Walks pulldown_cmark::Event and assembles a Document. The parser enables the same extensions moss’s pipeline does: tables, footnotes, strikethrough.

All URL nodes start as Url::Unresolved; classifying into Url::Resolved is the job of crate::ast::visit::visit_urls_mut (a separate pass).

Heading IDs ARE assigned by this parser. Phase 4 PR2: each Tag::Heading arm computes the Obsidian-compatible anchor slug from the heading’s text content (only Event::Text / Event::Code, matching production’s transform_events behavior in src-tauri/src/build/markdown/pipeline.rs lines 1776-1845); a post-parse pass ([assign_heading_id_suffixes]) walks all headings in document order (recursively into BlockQuotes, lists, callouts) and applies duplicate-suffix numbering ({slug}-1, -2, …) matching the id_counts HashMap behavior at pipeline.rs:1798.

Structs§

ParseConfig
Parser configuration flags.

Functions§

parse
Parse markdown into a typed Document using the default config.
parse_with_config
Parse markdown into a typed Document.
parser_options
The pulldown-cmark option set moss parses markdown with.
unwrap_implicit_figures
Undo implicit-figure promotion across a whole document.