parseDocument function

MdDocument parseDocument(
  1. String src,
  2. bool useDollar, [
  3. MarkdownBlockRegistry? registry,
  4. MarkdownDefinitions? definitions,
  5. MarkdownHtml? html,
])

Parses src. Link and footnote definitions are collected from src itself unless definitions is given — the incremental view passes the whole document's, because it parses one segment at a time.

Implementation

MdDocument parseDocument(
  String src,
  bool useDollar, [
  MarkdownBlockRegistry? registry,
  MarkdownDefinitions? definitions,
  MarkdownHtml? html,
]) {
  final lines = documentLines(src);
  final defs =
      definitions ??
      MarkdownDefinitions.collectLines(
        lines,
        blockRegistry: registry,
        html: html,
      );
  return MdDocument(
    children: parseBlocks(lines, useDollar, registry, defs, html),
  );
}