@@ -38,32 +38,32 @@ for (const link of toc.match(/<a.*?>/g)) { |
38 | 38 | .replace(/[\s\S]*?id="toc"[^>]*>\s*<\w+>.*?<\/\w+>\s*(<ul>\s*)?/, '') |
39 | 39 | // Prefix TOC links with current module name |
40 | 40 | .replace(/<a href="#(?!DEP[0-9]{4})([^"]+)"/g, (match, anchor) => { |
41 | | - return `<a href="#${moduleName}_${anchor}"`; |
| 41 | + return `<a href="#all_${moduleName}_${anchor}"`; |
42 | 42 | }); |
43 | 43 |
|
44 | 44 | apicontent += '<section>' + data.slice(match.index + match[0].length) |
45 | 45 | .replace(/<!-- API END -->[\s\S]*/, '</section>') |
46 | 46 | // Prefix all in-page anchor marks with module name |
47 | 47 | .replace(/<a class="mark" href="#([^"]+)" id="([^"]+)"/g, (match, anchor, id) => { |
48 | 48 | if (anchor !== id) throw new Error(`Mark does not match: ${anchor} should match ${id}`); |
49 | | - return `<a class="mark" href="#${moduleName}_${anchor}" id="${moduleName}_${anchor}"`; |
| 49 | + return `<a class="mark" href="#all_${moduleName}_${anchor}" id="all_${moduleName}_${anchor}"`; |
50 | 50 | }) |
51 | 51 | // Prefix all in-page links with current module name |
52 | 52 | .replace(/<a href="#(?!DEP[0-9]{4})([^"]+)"/g, (match, anchor) => { |
53 | | - return `<a href="#${moduleName}_${anchor}"`; |
| 53 | + return `<a href="#all_${moduleName}_${anchor}"`; |
54 | 54 | }) |
55 | 55 | // Update footnote id attributes on anchors |
56 | 56 | .replace(/<a href="([^"]+)" id="(user-content-fn[^"]+)"/g, (match, href, id) => { |
57 | | - return `<a href="${href}" id="${moduleName}_${id}"`; |
| 57 | + return `<a href="${href}" id="all_${moduleName}_${id}"`; |
58 | 58 | }) |
59 | 59 | // Update footnote id attributes on list items |
60 | | - .replace(/<(\S+) id="(user-content-fn-\d+)"/g, (match, tagName, id) => { |
61 | | - return `<${tagName} id="${moduleName}_${id}"`; |
| 60 | + .replace(/<(\S+) id="(user-content-fn[^"]+)"/g, (match, tagName, id) => { |
| 61 | + return `<${tagName} id="all_${moduleName}_${id}"`; |
62 | 62 | }) |
63 | 63 | // Prefix all links to other docs modules with those module names |
64 | 64 | .replace(/<a href="((\w[^#"]*)\.html)#/g, (match, href, linkModule) => { |
65 | 65 | if (!htmlFiles.includes(href)) return match; |
66 | | - return `<a href="#${linkModule}_`; |
| 66 | + return `<a href="#all_${linkModule}_`; |
67 | 67 | }) |
68 | 68 | .trim() + '\n'; |
69 | 69 |
|
|