fix(metadata): use short deprecation anchors#933
Conversation
Assisted-by: OpenAI Codex
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@vsolano9 is attempting to deploy a commit to the OpenJS Foundation Team on Vercel. A member of the Team first needs to authorize it. |
PR SummaryLow Risk Overview Metadata parsing adds Legacy HTML skips the extra legacy alias anchor when it would duplicate the primary Reviewed by Cursor Bugbot for commit a7ee557. Bugbot is set up for automated code reviews on this repo. Configure here. |
| */ | ||
| const getHeadingSlug = text => { | ||
| const deprecationHeading = | ||
| api === 'deprecations' && DEPRECATION_HEADING_REGEX.exec(text); |
There was a problem hiding this comment.
| api === 'deprecations' && DEPRECATION_HEADING_REGEX.exec(text); | |
| DEPRECATION_HEADING_REGEX.exec(text); |
There was a problem hiding this comment.
Applied the direct regex call. The /deprecations page check now stays in the return condition so DEP-like headings on other pages continue to use normal slugging.
| return deprecationHeading | ||
| ? nodeSlugger.slug(deprecationHeading[1]).toUpperCase() | ||
| : nodeSlugger.slug(text); |
There was a problem hiding this comment.
Does nodeSlugger need to run on deprecationHeading[1]? Isn't that our slug itself?
There was a problem hiding this comment.
It still needs the stateful slugger for duplicate codes: repeated DEP0001 headings must become DEP0001 and DEP0001-1. The duplicate-code regression covers that behavior, so I retained nodeSlugger.
Add regression coverage for matching primary and legacy anchors. Assisted-by: OpenAI Codex Signed-off-by: Victor Solano <victor.solanonunez@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1df29b. Configure here.
Share the deprecation heading matcher and classify the published fragment change as minor. Assisted-by: OpenAI Codex Signed-off-by: Victor Solano <victor.solanonunez@gmail.com>

Description
Use short
DEP####codes as metadata slugs for headings on the deprecations page. This keeps duplicate handling in the existing stateful slugger, preserves ordinary slugging outsidedeprecations, and avoids emitting a duplicate legacy HTML alias when the primary slug is already short.This changes web and Orama links from long heading-derived fragments to stable links such as
#DEP0001. Legacy JSON andllms.txtoutputs are byte-identical to the base for the tested deprecations source.Assisted-by: OpenAI Codex
Validation
npm ci(0 vulnerabilities)node --run test:ci: 512 passed, 0 failednode --run lint: 0 errors, 2 pre-existing warnings inuseOrama.mjsnode --run format:checkchangeset status --since=mainnode --run test:e2e: 4 passede6e6f677b34ba0fc87e897512feee11e4d2c0ca4withlegacy-html,legacy-json,web,orama-db, andllms-txt; short anchors were verified in legacy HTML, web, and Orama, with legacy JSON andllms.txtunchanged from baseRelated Issues
Fixes #790
Check List
node --run testand all tests passed.node --run format:checkandnode --run lint.