Skip to content

fix: skip fenced code blocks when extracting wikilinks#4

Open
purisev wants to merge 1 commit into
praneybehl:mainfrom
purisev:fix/wikilink-in-fenced-code
Open

fix: skip fenced code blocks when extracting wikilinks#4
purisev wants to merge 1 commit into
praneybehl:mainfrom
purisev:fix/wikilink-in-fenced-code

Conversation

@purisev

@purisev purisev commented Jul 1, 2026

Copy link
Copy Markdown

[[...]] inside a fenced code block (e.g. Telegraf TOML [[outputs.influxdb]])
gets parsed as a wikilink by every script that scans page bodies for links,
producing false broken-link/orphan/edge results.

Adds strip_code() (strips ``` fenced blocks before wikilink extraction) to
wiki_lint.py, wiki_search.py, wiki_stats.py, wiki_graph_extract.py, and
wiki_graph_lint.py. Inline single-backtick code is untouched — wikilinks
wrapped in backticks for emphasis still count as links.

Smoke-tested per CONTRIBUTING.md against a wiki with a TOML block containing
[[outputs.influxdb]] plus a real [[wikilink]] — no false positives, real
links still tracked correctly, across all five scripts.

Signed-off-by: Iurii Purisev <92510590+purisev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant