Skip to content

Commit 849213e

Browse files
committed
doc: simplify linkModule parsing by moving into regex
1 parent 91ee128 commit 849213e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/doc/allhtml.mjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ for (const link of toc.match(/<a.*?>/g)) {
5353
return `<a href="#${moduleName}_${anchor}"`;
5454
})
5555
// Prefix all links to other docs modules with those module names
56-
.replace(/<a href="(\w[^#"]*)#/g, (match, href) => {
56+
.replace(/<a href="((\w[^#"]*)\.html)#/g, (match, href, linkModule) => {
5757
if (!htmlFiles.includes(href)) return match;
58-
const linkModule = href.replace(/\.html$/, '');
5958
return `<a href="#${linkModule}_`;
6059
})
6160
.trim() + '\n';

0 commit comments

Comments
 (0)