Skip to main content

Module highlight

Module highlight 

Source
Expand description

Syntax highlighting for fenced code blocks, done while the page renders.

Code is wrapped in spans whose classes name syntax scopes (hl-keyword, hl-string…); the stylesheet colors those classes from theme tokens, so highlighting follows the light and dark themes like everything else. Mermaid blocks are left as plain text for diagrams to draw.

Structs§

Highlighter

Functions§

highlight
code highlighted as lang, as the HTML that goes inside a <code>.