Skip to content

Commit 5c11a02

Browse files
TrottBethGriggs
authored andcommitted
tools: make internal link checker more robust
The internal link checker was missing some broken links because it was being too restrictive about the characters it accepted as part of a link hash. Accept anything that isn't a terminating quotation mark. Refs: #39426 Refs: #39425 PR-URL: #39429 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
1 parent 9d950a0 commit 5c11a02

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tools/doc/allhtml.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ fs.writeFileSync(new URL('./all.html', source), all, 'utf8');
7676

7777
// Validate all hrefs have a target.
7878
constids=newSet();
79-
constidRe=/id="(\w+)"/g;
79+
constidRe=/id="([^"]+)"/g;
8080
letmatch;
8181
while(match=idRe.exec(all)){
8282
ids.add(match[1]);
8383
}
8484

85-
consthrefRe=/href="#(\w+)"/g;
85+
consthrefRe=/href="#([^"]+)"/g;
8686
while(match=hrefRe.exec(all)){
8787
if(!ids.has(match[1]))thrownewError(`link not found: ${match[1]}`);
8888
}

0 commit comments

Comments
 (0)