Skip to content

Consolidate link following behaviors - #218

Merged
cyanzhong merged 1 commit into
mainfrom
develop
Oct 24, 2026
Merged

cyanzhong merged 1 commit into
mainfrom
develop

Conversation

@cyanzhong

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused refactor addresses the reported mismatch with targeted regression coverage and no identified blocking issues.

No open issues 🎉

What changed in this PR

Unifies heading-anchor resolution between preview and hidden-syntax navigation, addressing the punctuation mismatch reported in MarkEdit issue #1832.

Changes:

  • Adds shared heading-anchor generation and target lookup.
  • Uses the shared lookup in preview navigation and heading-line resolution.
  • Adds regression coverage for punctuation, Unicode, duplicate headings, and non-heading targets.
File Description
tests/​navigation.test.ts Tests shared heading resolution and preservation of non-heading targets.
tests/​frontMatter.test.ts Updates expected heading HTML for the new anchor attribute.
src/​render.ts Registers heading-anchor generation and shares target lookup.
src/​features/​navigation.ts Uses shared lookup for preview links.
src/​features/​anchors.ts Implements heading-anchor generation and target resolution.

Review effort: Balanced

@cyanzhong
cyanzhong merged commit 5bdd252 into main Oct 24, 2026
2 checks passed
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.

2 participants