Skip to content

fix(cli): validate local anchor links - #2258

Open
kadymov wants to merge 2 commits into
masterfrom
codex/DOCSTOOLS-6419-anchor-validation
Open

kadymov wants to merge 2 commits into
masterfrom
codex/DOCSTOOLS-6419-anchor-validation

Conversation

@kadymov

@kadymov kadymov commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Description

  • validate local Markdown link fragments through the existing YFM002 rule
  • collect rendered anchor IDs for automatic, explicit, duplicate, block, and included anchors
  • preserve YFM003 precedence for missing or unreachable target pages
  • avoid a duplicate YFM010 diagnostic for an autotitle whose anchor is missing
  • invalidate the anchor cache when page or included content changes

How to test

npm test
npm run typecheck
npm run lint
npm run e2e

Focused regression checks:

npm test -- src/commands/build/services/anchors/AnchorsService.spec.ts src/commands/build/features/output-html/plugins/links.spec.ts
npm run e2e -- tests/e2e/errors.spec.ts

All commands above passed locally. The lint command reports four pre-existing warnings in src/commands/build/services/entry/EntryService.ts and no errors.

Tracker: DOCSTOOLS-6419

@sonarqubecloud

Copy link
Copy Markdown

@kadymov
kadymov marked this pull request as ready for review September 17, 2026 16:08
@kadymov
kadymov requested review from a team and diplodoc-bot as code owners September 17, 2026 16:08
@kadymov
kadymov requested review from goldserg and stenin-nikita and removed request for a team September 17, 2026 16:08
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