Hwaro::Content::Processors::LineWrapper
Wraps already-highlighted (or plain-escaped) code body HTML with
per-line <span class="line"> markup for line numbers / highlighted
lines — pure string post-processing, zero Tartrazine calls, applied
AFTER (and outside) ServerHighlighter's gated tokenization, over
its already-cached result.
Constants
Instance methods
Splits already-highlighted HTML (a flat stream of
<span class="...">ESCAPED</span> and bare ESCAPED text — never
nested, and the escaped text never contains a raw </>) into
one string per physical source line, re-opening any span whose
class carries across a newline (a token's value can itself
contain \n, e.g. a multi-line string literal).
Wraps each physical line of already-highlighted body in a
<span class="line"> ( hl appended for highlighted lines),
optionally prefixing a <span class="ln"> gutter number.
hl_lines/hide_lines ranges are matched against the PHYSICAL
1-based line number — never shifted by linenostart.
Hidden lines are elided from the output but KEEP consuming their
physical line numbers, so the gutter shows gaps (unlike Zola,
which renumbers). This preserves the documented invariant that
hl_lines and linenostart always target physical lines.