Reference

std/markdown

Markdown as a document format, written in TorbScript: CommonMark with the tables of GitHub Flavored Markdown and front matter. Markdown reads a text into a MarkdownDocument, a tree of blocks and inlines that is a value, and HTML is a separate step over that tree.

const document = Markdown().parse(text)
for block in document.blocks {
  if const .Heading(level, inlines) = block.content {
    print "{level}: {plainText(inlines)}"
  }
}
print document.html()

Every block knows the lines it spans, and every link the line it starts on, so a tool that checks a document can name the line of what it found.

Modules

Everything