Summary
mdbase graph broken reports wikilink-looking literals inside inline code spans and fenced code blocks as broken links.
Repro
A note containing a literal example in backticks:
Escaped-pipe table links `[[x\|alias]]` don't cascade; bare `[[example]]` is shown here as a literal.
mdbase graph broken reports targets x\|alias / example as broken links, although they are documentation examples, not links.
Root cause
dist/commands/graph.js implements its own extractWikilinks() — a bare wikilink regex over raw file text, with no code-span/fence exclusion.
Meanwhile the mdbase library already handles this correctly: @callumalpass/mdbase dist/links/parser.js → extractBodyLinks() skips fenced code blocks, indented code, and inline code spans (removeInlineCode()). I verified: on the same lines extractBodyLinks() returns no links, while graph broken counts them.
This also means the rename cascade (which uses the library parser and correctly ignores code spans) and graph disagree about what counts as a link.
Suggestion
Reuse the library's extractBodyLinks() in graph.js for body links instead of the local regex, so graph analysis and link cascading share one definition of a link.
Impact
False positives make graph broken noisy as a post-rename health check in collections whose docs contain wikilink syntax examples.
Version: mdbase-cli 0.1.0 (Homebrew-installed via npm, macOS).
Summary
mdbase graph brokenreports wikilink-looking literals inside inline code spans and fenced code blocks as broken links.Repro
A note containing a literal example in backticks:
mdbase graph brokenreports targetsx\|alias/exampleas broken links, although they are documentation examples, not links.Root cause
dist/commands/graph.jsimplements its ownextractWikilinks()— a bare wikilink regex over raw file text, with no code-span/fence exclusion.Meanwhile the mdbase library already handles this correctly:
@callumalpass/mdbasedist/links/parser.js→extractBodyLinks()skips fenced code blocks, indented code, and inline code spans (removeInlineCode()). I verified: on the same linesextractBodyLinks()returns no links, whilegraph brokencounts them.This also means the rename cascade (which uses the library parser and correctly ignores code spans) and
graphdisagree about what counts as a link.Suggestion
Reuse the library's
extractBodyLinks()ingraph.jsfor body links instead of the local regex, so graph analysis and link cascading share one definition of a link.Impact
False positives make
graph brokennoisy as a post-rename health check in collections whose docs contain wikilink syntax examples.Version: mdbase-cli 0.1.0 (Homebrew-installed via npm, macOS).