Expand description
Safe, dependency-free lexical syntax highlighting.
One generic scanner is parameterized by static language profiles. The
output is safe HTML: source text is escaped here, and the only markup this
module emits is its own fixed tok-* spans.
Functionsยง
- highlight_
hunk - Highlight a diff hunk with independent lexer state for its old and new sides. Context advances both streams and renders from the new side.
- highlight_
lines - Highlight a contiguous run of source lines. Unknown paths return
None, allowing callers to preserve their plain escaped rendering.