Skip to content

Support standalone HTML section anchors without losing source - #100

Draft
BinaryOutlook wants to merge 2 commits into
mainfrom
feat/html-anchor-compatibility
Draft

BinaryOutlook wants to merge 2 commits into
mainfrom
feat/html-anchor-compatibility

Conversation

@BinaryOutlook

@BinaryOutlook BinaryOutlook commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Standalone empty HTML anchors currently appear as literal text, and fragment navigation searches headings only. This makes legacy section links fail after a heading is renamed.

Recognize restricted, quoted id/name anchors as invisible document metadata. Resolve their fragments using editor-scoped target comparisons. Preserve exact anchor source through saves and Undo/Redo; visual deletion or replacement moves hidden anchors before the resulting content rather than removing them. HTML export emits inert targets through the existing sanitizer. Arbitrary HTML remains disabled; inline and nested anchors remain literal source.

Reproduction:

[Jump](#legacy-section)

<a id="legacy-section"></a>

## Renamed section

Body

Added parser tests, ten browser regressions, an installed-VSIX native suite, and maintained usage/validation documentation. Examples and fixtures are synthetic.

Validation:

  • Node 24.21.0: full compilation and clean-commit packaging pass.
  • Complete unit suite: 372 passed, 19 prerequisite skips, zero failures. Separate packaged-runtime integrity gate passes.
  • Complete Chromium suite: 1,290 passed with retries disabled. A temporary local configuration directs both configured and legacy hard-coded URLs to the owned test fixture server.
  • Installed macOS VS Code 1.138.0: anchor layout, fragment navigation, real keyboard editing, Undo/Redo, Source switching, exact save/reopen bytes, and HTML export pass. These checks also pass after reinstalling the final clean-commit package.
  • Raw and rendered reviews of all four affected Markdown files pass. Documentation checks pass (87 files, 667 local links); whitespace checks pass. Lint reports zero errors and 11 existing warnings in untouched files.
  • Earlier hosted runs failed because the new native export assertion omitted the sanitizer’s existing safe rel attribute. The reviewed test-only correction validates that attribute; hosted validation for the corrected revision remains in progress.

Related: #16. No package version change, merge, or release publication.

Local development package identity: package version 0.4.1, source c1ad0ade36dfbbe6668de063a87eef1db22f8e08, clean source tree, SHA-256 f0911cbdecb4cf7f4b141636e74d3fc107aa4f2f7858f88b6b5887c3e470ddde. This is a development snapshot, not a release candidate.

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