Skip to content

Fix global linkMappings not matching bare-path links#22

Merged
larkiny merged 2 commits into
mainfrom
fix/bare-path-global-linkmappings
Feb 16, 2026
Merged

Fix global linkMappings not matching bare-path links#22
larkiny merged 2 commits into
mainfrom
fix/bare-path-global-linkmappings

Conversation

@larkiny

@larkiny larkiny commented Feb 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bare-path links (e.g., docs/markdown/autoapi/foo/) were incorrectly normalized as file-relative before global linkMappings could match them
  • Global mappings are now tried against the raw link path first; if none match, the existing normalized-path flow runs unchanged
  • This is additive — existing behavior for ./ and ../ links is completely preserved

Test plan

  • New test verifies bare-path link is rewritten by global linkMapping even when target files aren't imported
  • All 300 tests pass (299 existing + 1 new)
  • tsc --noEmit clean

Larkin Young added 2 commits February 16, 2026 20:01
stripPrefixes in ImportLinkTransformOptions is now optional,
defaulting to ['src/content/docs'] (the Starlight content root).
This eliminates repetitive boilerplate in consumer configs.
Bare-path links (e.g., "docs/markdown/autoapi/foo/") were incorrectly
normalized as file-relative before global linkMappings could match them.
Now global mappings are tried against the raw link path first; if none
match, the existing normalized-path flow runs unchanged.
@larkiny
larkiny merged commit 4633a6f into main Feb 16, 2026
1 check passed
@larkiny
larkiny deleted the fix/bare-path-global-linkmappings branch February 16, 2026 21:34
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