syntax/lezer/lezer-html
Renders a @lezer/markdown tree to HTML the way the CommonMark reference implementation does, so the tree can be checked against the CommonMark and GFM spec suites.
The tree keeps no text of its own, only node ranges, so the renderer reads the text back from the source: it takes container prefixes (quote marks and list item indentation) off the lines of code and HTML blocks, and strips the leading whitespace of a paragraph’s lines, as a CommonMark parser does before it reads inline content.
@lezer/markdown does not check that a link reference is defined (see lezer-commonmark.ts). The renderer looks each label up, and renders a link whose label is undefined as its text with its brackets.
The Obsidian nodes are rendered as their content, since the spec suites hold none. This is not the reading view’s HTML.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| RenderLezerHtmlOptions | Options of renderLezerHtml. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| renderLezerHtml | Renders a @lezer/markdown tree to HTML as the CommonMark reference implementation renders the document. |