Documentation

Lean.Data.Markdown

Markdown Parser #

A CommonMark parser that records the source range of every construct. The Lean language server uses it to provide semantic tokens inside Markdown docstrings. The entry point is Lean.Markdown.parseDocument.

The implementation follows CommonMark 0.31.2, with one deviation: link labels are case folded for ASCII, Latin-1, and Greek letters, and compared case-sensitively for all other characters.

The parser additionally supports one optional non-standard extension: LaTeX-style math in $…$ and $$…$$.