Hwaro::Content::Processors::Wikilinks
Constants
A footnote definition starts a new block, as a list item does. Same
shape preprocess_footnotes extracts (FOOTNOTE_DEF_RE there).
The blockquote markers a line opens with.
One blockquote marker, as TableParser strips it for a quoted table.
A line matched on its own, never joined to a chunk: an ATX heading,
a setext underline or thematic break. Table rows are too (see
walk), each row being its own block.
\(…\) TeX math, kept verbatim with [markdown] math (the $
forms are stashed by MarkdownExtensions.protect_math). Precedes
ESC_TOKEN, which would otherwise take its \(.
The other link forms backlinks count: a Markdown destination
(](url, which rewrite also keeps verbatim, so a [[x]] inside
a URL is never rewritten) and a link reference definition
([label]: url, not a footnote). HTML hrefs are read out of the
tag token.
Tokens kept verbatim, matched over one paragraph-sized chunk: a
code span (which may cross a line break), an HTML comment, an HTML
tag (Markd's grammar, so attribute values are never rewritten), an
autolink (<https://x/[[y]]>) and a backslash escape (\[[x]]
stays literal).
Class methods
Instance methods
Yields every link-ish token where rewrite would see one: a parsed
wikilink, or the URL of a Markdown destination / link reference
definition / HTML href. Hrefs in raw HTML blocks count too (the
build renders them as links), though rewrite leaves those lines
alone.
Rewrite every wikilink in content (see the file comment). An
unresolved one renders as a wikilink-missing span (plain text in
safe mode), is warned about, and is appended to misses as
{"[[…]]" source text, reason}.