Repository navigation
Conversation
#610 replaced the `--+` collapse with `/^(?!-)(?!-+$).*?(--+)/`, which also swallows everything before the first run of hyphens, so headings lost their prefix: `-c`, `--check` became `#-check` and `DEP0062: node --debug` became `#-debug`. nodejs.org/api serves those anchors today. The old tooling (getId in tools/doc/html.mjs) never collapsed or trimmed hyphens: it lowercased, dropped punctuation and turned spaces into hyphens, which is what github-slugger already does. Dropping the three hyphen rules matches its anchors for all 5809 headings in doc/api, where the current rules differ on 18 of them. That's the same drift #757 reported for `--` flags, which #810 fixed for that one case. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1232 +/- ##
==========================================
- Coverage 94.14% 94.14% -0.01%
==========================================
Files 291 291
Lines 28942 28934 -8
Branches 2942 2938 -4
==========================================
- Hits 27248 27240 -8
Misses 1672 1672
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| File | Main | PR | Change |
|---|---|---|---|
single-executable-applications.html |
127.78 KB | 127.97 KB | +192.00 B (+0.1%) |
cli.html |
372.69 KB | 372.85 KB | +168.00 B (+0.0%) |
webstreams.html |
297.01 KB | 297.15 KB | +140.00 B (+0.0%) |
module.html |
364.54 KB | 364.63 KB | +88.00 B (+0.0%) |
tls.html |
297.30 KB | 297.33 KB | +28.00 B (+0.0%) |
buffer.html |
1.17 MB | 1.17 MB | +20.00 B (+0.0%) |
Performance estimate (single CI run)
- Generation time: 0.3% slower (16.46 s → 16.51 s)
- Peak memory: 3.7% higher (1.46 GB → 1.52 GB)
legacy-json Generator
Performance estimate (single CI run)
- Generation time: 10.9% faster (8.10 s → 7.22 s)
- Peak memory: 4.6% higher (916.79 MB → 959.26 MB)
llms-txt Generator
Performance estimate (single CI run)
- Generation time: 17.8% faster (6.40 s → 5.26 s)
- Peak memory: 4.1% higher (957.82 MB → 997.05 MB)
orama-db Generator
Output size: 1 file changed · net +2.89 KB
File size details
| File | Main | PR | Change |
|---|---|---|---|
orama-db.json |
29.66 MB | 29.67 MB | +2.89 KB (+0.0%) |
Performance estimate (single CI run)
- Generation time: 14.2% slower (8.04 s → 9.18 s)
- Peak memory: 4.3% lower (1.09 GB → 1.04 GB)
web Generator
Output size: 7 files changed · net +1.02 KB
File size details
| File | Main | PR | Change |
|---|---|---|---|
all.html |
34.78 MB | 34.78 MB | +522.00 B (+0.0%) |
single-executable-applications.html |
170.64 KB | 170.83 KB | +192.00 B (+0.1%) |
cli.html |
678.78 KB | 678.95 KB | +168.00 B (+0.0%) |
webstreams.html |
565.36 KB | 565.43 KB | +70.00 B (+0.0%) |
module.html |
533.05 KB | 533.09 KB | +44.00 B (+0.0%) |
tls.html |
550.15 KB | 550.17 KB | +28.00 B (+0.0%) |
buffer.html |
1.82 MB | 1.82 MB | +20.00 B (+0.0%) |
Performance estimate (single CI run)
- Generation time: 23.6% faster (20.14 s → 15.39 s)
- Peak memory: 3.5% higher (1.48 GB → 1.53 GB)
|
#1232 (comment) Is there a way to generate a preview link for this PR's edits in the comments here? |
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.main-c,--check#-c---check#-check#-c---checknew ReadableStream([underlyingSource [, strategy]])#new-readablestreamunderlyingsource--strategy#-strategy#new-readablestreamunderlyingsource--strategyIt'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:mainRelated Issues
Refs: #757, #610
Check List
node --run testand all tests passed.node --run format:check&node --run lint.