fix(metadata): keep hyphens in heading slugs like the old doc tooling #1232
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 296 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.341
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1232"
general
weight: 0.35
avivkeller
Description
This PR makes heading anchors match the old Node.js doc tooling again, by dropping the three hyphen rules from
DOC_API_SLUGS_REPLACEMENTS.#610 swapped the
--+collapse for/^(?!-)(?!-+$).*?(--+)/, which also swallows everything before the first run of hyphens. That's how nodejs.org/api ends up serving#-checkfor-c,--check. The old tooling (getIdintools/doc/html.mjs) never collapsed or trimmed hyphens at all: it lowercased, dropped punctuation and turned spaces into hyphens, which is what github-slugger already does. So rather than fixing the collapse, this stops post-processing hyphens.| Heading | v24 docs (old tooling) |
main| This PR || --- | --- | --- | --- |
|
-c,--check|#-c---check|#-check|#-c---check||
new ReadableStream([underlyingSource [, strategy]])|#new-readablestreamunderlyingsource--strategy|#-strategy|#new-readablestreamunderlyingsource--strategy|It's the same drift #757 reported for
--flags, which #810 fixed for that one case. The slugger tests now pin the old tooling's behaviour; the ones they replace came from #676 and captured #610's output (foo--bar→-bar).Validation
node --run test(782 tests),node --run lintandnode --run format:checkpass.doc/api, the slugs now match the oldgetIdexactly. Onmain, 18 of them differ.cli.mdwithlegacy-htmlgives#-c---checkand#-e---eval-script, as in the v24 docs.Opening
cli.html#-c---check, the v24 anchor, in alegacy-htmlbuild ofcli.md:|
main| This PR || --- | --- |
| <img width="1280" height="720" alt="main: the page stays at the top, as the anchor doesn't exist" src="https://github.com/user-attachments/assets/6d59eefd-5ff8-4aed-b866-9bdd949e9086" /> | <img width="1280" height="720" alt="This PR: the page scrolls to the -c, --check heading" src="https://github.com/user-attachments/assets/a4312375-52b3-4ad9-a689-f1301f746df6" /> |
Related Issues
Refs: #757, #610
Check List
node --run testand all tests passed.node --run format:check&node --run lint.