Skip to content

Ignore references overlapping inline code spans#455

Open
thynomex wants to merge 1 commit into
Feel-ix-343:mainfrom
thynomex:codex-ignore-inline-code-reference-overlap-269
Open

Ignore references overlapping inline code spans#455
thynomex wants to merge 1 commit into
Feel-ix-343:mainfrom
thynomex:codex-ignore-inline-code-reference-overlap-269

Conversation

@thynomex

Copy link
Copy Markdown

Fixes #269

/claim #269

This fixes the false unresolved-reference diagnostic for literal [[ and ]] markers inside inline code spans.

Root cause: the codeblock filter only ignored references fully contained inside a code span. The reported text can create a single wikilink regex match that starts inside the first inline code span and ends inside the second, so it was not fully contained by either span.

Changes:

  • Add range-overlap detection for Rangeable values.
  • Filter references that overlap an inline/fenced code range when references_in_codeblocks is disabled.
  • Add a regression test for the reported inline-code [[ / ]] case while preserving a normal wikilink outside code.

Validation:

  • cargo test references_overlapping_inline_code_are_ignored -> passed
  • cargo fmt --check -> passed
  • cargo test -> 75 passed

@thynomex

Copy link
Copy Markdown
Author

/claim #269

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.

Unresolved reference when using [[ and ]]

1 participant