Skip to content

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

Draft
kadymov wants to merge 1 commit into
masterfrom
codex/DOCSTOOLS-6419-anchor-validation
Draft

kadymov wants to merge 1 commit 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

Quality Gate Failed Quality Gate failed

Failed conditions
77.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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