Expand description
Minimal, safety-first Markdown → HTML: used for comment bodies and for the rendered view of markdown files on the generated page.
Safety by construction: every input character is HTML-escaped first; the
only tags in the output are the ones this module emits, and link targets
are restricted to http:// / https:// / mailto: — hostile input
cannot smuggle markup or javascript: URLs.
Deliberately a SUBSET (documented in docs/PAGE.md): ATX headings, fenced
code blocks, flat (non-nested) lists, blockquotes, thematic breaks,
paragraphs; inline `code`, **bold**, *italic*, and
[links](https://…). Underscores are NOT emphasis, so snake_case
identifiers survive verbatim. A single newline inside a paragraph is a
hard break, matching how people write review comments.
Functions§
- to_html
- Render markdown
textto HTML. Pure and deterministic; never fails — anything unrecognized falls back to escaped literal text. - to_
html_ blocks - Like
to_html, but one entry per top-level block:(line, html), wherelineis the 0-based index (withintext) of the block’s first line. Concatenating thehtmlparts yields exactlyto_html(text). This is what lets the page anchor a comment on a rendered markdown block back to the source line the block starts at.