Skip to content

Validate spec URL fragments with @webref/xref - #4320

Open
schalkneethling wants to merge 1 commit into
web-platform-dx:mainfrom
schalkneethling:validate-spec-url-fragments
Open

Validate spec URL fragments with @webref/xref#4320
schalkneethling wants to merge 1 commit into
web-platform-dx:mainfrom
schalkneethling:validate-spec-url-fragments

Conversation

@schalkneethling

@schalkneethling schalkneethling commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Progress on #84.

Checks the fragment of every spec URL against the anchors w3c/webref crawls, using the same rules as BCD's spec_url linter (mdn/browser-compat-data#23958): skip fragment-less URLs, strip :~:text= fragments, lookup(url, { series: true, standing: "good" }).

  • Unknown fragments warn without failing the build; flip fragmentErrorsAreFatal in scripts/specs.ts to enforce once the data is clean.
  • npm run test:specs -- --report writes a self-contained HTML report of every fragment check to reports/spec-fragments.html.

Currently 32 of 1,356 spec URLs warn. Per @tidoust's suggestion, I'll relink those to current ids in a follow-up PR rather than asking webref to carry legacy alias ids.

Check the fragment of every spec URL against the definition and heading
anchors that w3c/webref crawls, using the same rules as BCD's spec_url
linter (skip fragment-less URLs, strip text fragments, lookup with
series: true and standing: good). Unknown fragments warn without
failing the build while existing data is cleaned up; flip
fragmentErrorsAreFatal to make them errors.

npm run test:specs -- --report additionally writes a self-contained
HTML report of every fragment check to reports/spec-fragments.html.

Progress on web-platform-dx#84

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant