Skip to content

Fix regression: scope bare-path global linkMappings guard - #23

Merged
larkiny merged 1 commit into
mainfrom
fix/bare-path-guard
Feb 16, 2026
Merged

Fix regression: scope bare-path global linkMappings guard#23
larkiny merged 1 commit into
mainfrom
fix/bare-path-guard

Conversation

@larkiny

@larkiny larkiny commented Feb 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes v0.14.2 regression where generic global mappings (.md-stripping from generateStarlightLinkMappings()) over-matched relative links (./foo.md, ../bar.md), bypassing sourceToTargetMap resolution
  • Adds isBareBarePath guard so pre-normalization global mapping pass only runs for bare paths (no ./, ../, /, or protocol prefix)
  • Adds 2 regression tests covering ./ and ../ links with .md-stripping global mappings

Test plan

  • New regression test: ./subscriber.md with .md-stripping global mappings resolves via sourceToTargetMap
  • New regression test: ../overview.md with global mappings resolves via normalization + sourceToTargetMap
  • Existing bare-path test still passes (bare paths are unaffected by the guard)
  • All 302 tests pass
  • tsc --noEmit clean

…aths only

The v0.14.2 fix applied global linkMappings to raw paths for all links,
but generic global mappings like .md-stripping would over-match relative
links (./foo.md, ../bar.md), causing early return and bypassing
sourceToTargetMap resolution. Now the pre-normalization pass only runs
for bare paths (no ./, ../, /, or protocol prefix).

Adds regression tests for ./ and ../ links with .md-stripping global
mappings to prevent this class of bug.
@larkiny
larkiny merged commit 96fcfef into main Feb 16, 2026
1 check passed
@larkiny
larkiny deleted the fix/bare-path-guard branch February 16, 2026 22:08
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