GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: validate apidoc links · nodejs/node@5e71d63

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tools/doc
    • allhtml.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tools/doc/allhtml.js‎

Copy file name to clipboardExpand all lines: tools/doc/allhtml.js
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,16 @@ all = all.slice(0, apiStart.index + apiStart[0].length) +
7373

7474
// Write results.
7575
fs.writeFileSync(source + '/all.html', all, 'utf8');
76+
77+
// Validate all hrefs have a target.
78+
const ids = new Set();
79+
const idRe = / id="(\w+)"/g;
80+
let match;
81+
while (match = idRe.exec(all)) {
82+
ids.add(match[1]);
83+
}
84+
85+
const hrefRe = / href="#(\w+)"/g;
86+
while (match = hrefRe.exec(all)) {
87+
if (!ids.has(match[1])) throw new Error(`link not found: ${match[1]}`);
88+
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.