Skip to content

HTML: Rewrite heading id anchors - #570

Open
markoub wants to merge 1 commit into
obsidianmd:masterfrom
markoub:markoub/html-heading-anchor-links
Open

HTML: Rewrite heading id anchors#570
markoub wants to merge 1 commit into
obsidianmd:masterfrom
markoub:markoub/html-heading-anchor-links

Conversation

@markoub

@markoub markoub commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Map same-document HTML links like href="#lexical-analysis" to the matching imported heading text before Markdown conversion.
  • Preserve non-local hash links, such as book.html#lexical-analysis and external URL fragments.
  • Add focused tests for the heading anchor rewrite helper.

Fixes #217

Validation

  • pnpm exec tsx --test tests/html/heading-links.test.ts
  • pnpm run test
  • pnpm run build
  • git diff --check
  • pnpm exec eslint src/formats/html.ts src/formats/html/heading-links.ts tests/html/heading-links.test.ts

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.

[HTML] Header links not working properly with id

1 participant