Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 59de0f7

Browse filesBrowse files
TrottBethGriggs
authored andcommitted
tools: udpate doc tools to accommodate GFM footnotes
PR-URL: #40477 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 4581997 commit 59de0f7
Copy full SHA for 59de0f7

File tree

Expand file treeCollapse file tree

3 files changed

+426
-166
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+426
-166
lines changed
Open diff view settings
Collapse file

‎tools/doc/allhtml.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/allhtml.mjs
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ for (const link of toc.match(/<a.*?>/g)) {
5252
.replace(/<a href="#(?!DEP[0-9]{4})([^"]+)"/g, (match, anchor) => {
5353
return `<a href="#${moduleName}_${anchor}"`;
5454
})
55+
// Update footnote id attributes on anchors
56+
.replace(/<a href="([^"]+)" id="(user-content-fn[^"]+)"/g, (match, href, id) => {
57+
return `<a href="${href}" id="${moduleName}_${id}"`;
58+
})
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}"`;
62+
})
5563
// Prefix all links to other docs modules with those module names
5664
.replace(/<a href="((\w[^#"]*)\.html)#/g, (match, href, linkModule) => {
5765
if (!htmlFiles.includes(href)) return match;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.