syntax/unified/micromark
The Obsidian syntax as a micromark syntax extension, built on the rules in spec.ts.
micromarkObsidianSyntax adds internal links and embeds, tags, %% comments, math, highlights, footnote references, inline footnotes, footnote definitions, block ids, callouts, Obsidian’s task markers and front matter. micromarkObsidianMarkdown adds the GFM pieces Obsidian supports as well: tables, strikethrough and bare URLs.
The tokens carry the names of ObsidianNode, so the events give the same outline as the @lezer/markdown tree. A micromark construct reads its input one character at a time, so most constructs here first look ahead with effects.check, collect the rest of the line or of the inline content, measure it with the rule in spec.ts, and then consume exactly that many characters.
Functions
Section titled “Functions”| Function | Description |
|---|---|
| createMicromarkObsidianMarkdown | The micromark syntax extensions for the syntax the options turn on: the GFM extensions it turns on, then the Obsidian syntax, so that its constructs take precedence, then the quirks the options ask for. |
| createMicromarkObsidianSyntax | The micromark syntax extension for the Obsidian syntax the flags turn on. |
| Type | Description |
|---|---|
| CreateMicromarkObsidianMarkdownOptions | The options of createMicromarkObsidianMarkdown: the syntax to read. |
Variables
Section titled “Variables”| Variable | Description |
|---|---|
| micromarkObsidianMarkdown | The Obsidian syntax with the GFM extensions Obsidian supports: tables, strikethrough and bare URLs. Obsidian’s task markers replace GFM’s. The Obsidian syntax comes last, so its constructs take precedence. |
| micromarkObsidianSyntax | The Obsidian syntax as a micromark syntax extension. |
| ObsidianToken | The tokens the extension emits besides the ObsidianNode names. |