Hwaro::Content::Processors::HookedRenderer
Inherits Hwaro::Content::Processors::HighlightingRenderer / Markd::HTMLRenderer / Markd::Renderer / Reference / Object
Renderer used only when at least one templates/hooks/render-*
template is configured (RenderHooks.registry is non-nil). Every
override starts with return super unless @hooks.<hook>?, so an
element the registry has no hook for renders exactly as
HighlightingRenderer would — this class adds no branches to the
stock class itself.
Link/Image/Heading are containers (Markd's walker visits them
twice: entering, then leaving with their children already
rendered in between); the hook needs the children's rendered HTML
as a single string, so push_capture/pop_capture temporarily
swap @output_io/@last_output (the same buffer
Markd::Renderer#literal/#output write to) for a scratch
buffer, nesting correctly via @capture_stack for e.g. a link
inside a heading, or an image inside a link.
Constants
Matches the first paragraph of a rendered admonition blockquote
(> [!NOTE] ...). Built from the same type list the postprocess
regex uses, so the two can't drift apart.
Constructors
Instance methods
CodeBlock is a leaf — the walker yields exactly one (entering:
true) event for it, matching HighlightingRenderer#code_block.
Mirrors Markd::HTMLRenderer#image's @disable_tag protocol
exactly (see the module doc above): a link or another image
nested inside this image's alt text never gets its own tag, and
neither does a nested hook — it just contributes plain text to
this image's alt, same as stock.