Skip to content

parseMdast

Parses a markdown document into an mdast tree with the Obsidian syntax, or with the syntax and the quirks the options ask for.

With the looseList: 'blank-line-anywhere' quirk, a list item is spread when a blank line inside it is followed by more of it, as in Obsidian’s tree, so a list renders loose when any of its items is.

Import:

import { parseMdast } from '@mnaoumov/obsidian-markdown-parser';

Signature:

function parseMdast(markdown: string, options: ObsidianSyntaxOptions | undefined): Root

Parameters:

Parameter Type Description
markdown string The document to parse.
options ObsidianSyntaxOptions | undefined The syntax to read, and the quirks to apply.

Returns: Root — The document’s mdast tree.


Links to this page: