Hwaro::CLI::Commands::Tool::DeadlinkCommand
Constants
A CommonMark autolink (<https://example.com/x>) renders as an
<a href> just like [text](url), but neither the inline-link
pass nor the raw-HTML pass (which wants a tag name) saw it, so
an autolinked URL was never checked.
An escaped \<https://…> (odd run of backslashes) is literal text.
Flags defined here are used both for OptionParser and completion generation
A raw HTML block (a block opening with a block-level tag, or with
a line holding one complete tag) is passed through verbatim, so an
autolink-shaped <https://…> inside it is not a link.
<a href> / <img src|srcset> / <source src|srcset> written
directly in Markdown. <source> matters because <picture> and
<video> blocks are the common hand-written HTML in docs content.
The value may be unquoted (href=/x/), which stops at whitespace
or >; a quoted value may contain > (title="a > b").
Matched in two passes — tag, then each attribute inside it — because
a single regex consumes the whole tag and so only ever reports the
FIRST link attribute: <img srcset="…" src="…"> lost its src.
Markdown link/image destination, allowing ONE level of balanced
parentheses inside it. Plain ([^\)]+) stopped at the first ),
so [x](/docs/foo_(bar)) was scanned as /docs/foo_(bar and
reported dead — a false positive on a link the build resolves fine.
The alternation branches start with disjoint characters, so there
is no backtracking ambiguity.
Single source of truth for command metadata
A Markdown link reference definition ([id]: /target/ "title").
Three guards keep this from inventing links: footnote definitions
([^1]: …) are skipped, the destination must look like a URL or
path, and — decisively — the label must actually be USED somewhere
in the document. Shape alone is not enough: the ordinary prose line
[Note]: /usr/bin is where the binary lives on most systems
has a path-shaped first token and was reported as a dead link. CommonMark only treats such a line as a definition when a matching reference exists, so requiring one removes the whole false-positive class rather than blacklisting shapes.
[text][label], [label][], and the shortcut form [label] — the
last excluding anything followed by (, [ or :, which is an
inline link, a full reference, or another definition.
ReadContent recognizes a section index only when the extension is
already lowercase (_index.md); _index.MD builds as a plain
page. Section probes (feeds, pagination) keep that exact match.