Skip to content

Require absolute path from bare-path global linkMapping early return - #25

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

Require absolute path from bare-path global linkMapping early return#25
larkiny merged 1 commit into
mainfrom
fix/bare-path-absolute-guard

Conversation

@larkiny

@larkiny larkiny commented Feb 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • The bare-path pre-normalization early return now requires the mapped result to start with / (absolute path)
  • Prevents generic global mappings like .md-stripping from hijacking multi-segment relative links (e.g., types/subscription.md) that should resolve via normalizePath() + sourceToTargetMap
  • Adds regression test for multi-segment relative sibling references with .md-stripping global mappings
  • Bumps version to 0.14.5

Test plan

  • New test: types/subscription.md#anchor resolves via sourceToTargetMap to absolute URL
  • All existing bare-path, ./, ../, and sibling reference tests still pass
  • All 304 tests pass
  • tsc --noEmit clean

The early return for bare-path global linkMappings now requires the
mapped result to start with "/" (absolute path). This prevents generic
global mappings like .md-stripping from hijacking multi-segment relative
links (e.g., "types/subscription.md") that should resolve via
normalizePath() + sourceToTargetMap.

Bumps version to 0.14.5.
@larkiny
larkiny merged commit 1a763df into main Feb 16, 2026
1 check passed
@larkiny
larkiny deleted the fix/bare-path-absolute-guard branch February 16, 2026 23:12
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