parse static method

MdDocument parse(
  1. String markdown, {
  2. bool useDollarSignsForLatex = false,
  3. MarkdownBlockRegistry? blockRegistry,
})

Parses markdown into a structured MdDocument tree.

Synchronous and fast — suitable for re-parsing streaming LLM output. Set useDollarSignsForLatex to also treat $ … $ / $$ … $$ as LaTeX in addition to the always-on \( … \) / \[ … \] forms (mirrors gpt_markdown's option).

Implementation

static MdDocument parse(
  String markdown, {
  bool useDollarSignsForLatex = false,
  MarkdownBlockRegistry? blockRegistry,
}) {
  return parseDocument(markdown, useDollarSignsForLatex, blockRegistry);
}