Hwaro::Content::Processors::HighlightingRenderer
Inherits Markd::HTMLRenderer < Markd::Renderer < Reference < Object
Custom HTML renderer that adds syntax highlighting support Extends Markd's HTMLRenderer to customize code block output
Constants
Constructors
Instance methods
Override code_block to add highlighting-specific attributes
In server mode, emit pre-highlighted spans instead of plain escaped
text. Falls back to the default escaped output when the language has
no lexer (the language-* class is still present for styling).
When fence options (line numbers / hl_lines) are present AND
active, the body is wrapped per-line instead — but ONLY in server
mode; client mode keeps this exact byte-for-byte legacy body no
matter what options were parsed (see code_block, which is what
adds the data-* attributes for the client-side case).
Safe mode replaces every raw-HTML node with an omission comment —
including the <!--HWARO-SHORTCODE-PLACEHOLDER-N--> comments the
shortcode pass leaves for its (trusted, template-rendered) output,
which silently erased every shortcode. Keep exactly those
placeholders; everything else in the node is still omitted.
Extension markup (tables, <del>, footnotes, math, …) is raw HTML
to markd too: a node that STARTS with hwaro-marked markup (see
MarkdownExtensions.trust) is kept, minus any author raw HTML in it.