Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/doc/allhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,13 @@ all = all.slice(0, apiStart.index + apiStart[0].length) +

// Write results.
fs.writeFileSync(source + '/all.html', all, 'utf8');

// Validate all hrefs have a target
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: a period in the end.

const ids = new Set();
all.replace(/ id="(\w+)"/g, (_text, id) => {
ids.add(id);
});

all.replace(/ href="#(\w+)"/g, (_text, href) => {
if (!ids.has(href)) throw new Error(`link not found: ${href}`);
});