| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -472,8 +472,8 @@ hr { | |||
| 472 | 472 | margin: 0 0 1rem; | |
| 473 | 473 | } | |
| 474 | 474 | ||
| 475 | - #toc h2 { | ||
| 476 | - margin: 1.5rem 0; | ||
| 475 | + #toc > ul { | ||
| 476 | + margin-top: 1.5rem; | ||
| 477 | 477 | } | |
| 478 | 478 | ||
| 479 | 479 | #toc p { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,10 +55,10 @@ <h1>Node.js __VERSION__ Documentation</h1> | |||
| 55 | 55 | <hr> | |
| 56 | 56 | </header> | |
| 57 | 57 | ||
| 58 | - <div id="toc"> | ||
| 59 | - <h2>Table of Contents</h2> | ||
| 58 | + <details id="toc" open> | ||
| 59 | + <summary>Table of Contents</summary> | ||
| 60 | 60 | __TOC__ | |
| 61 | - </div> | ||
| 61 | + </details> | ||
| 62 | 62 | ||
| 63 | 63 | <div id="apicontent"> | |
| 64 | 64 | __CONTENT__ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,10 +31,10 @@ for (const link of toc.match(/<a.*?>/g)) { | |||
| 31 | 31 | const data = fs.readFileSync(source + '/' + href, 'utf8'); | |
| 32 | 32 | ||
| 33 | 33 | // Split the doc. | |
| 34 | - const match = /(<\/ul>\s*)?<\/div>\s*<div id="apicontent">/.exec(data); | ||
| 34 | + const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ id="apicontent">/.exec(data); | ||
| 35 | 35 | ||
| 36 | 36 | contents += data.slice(0, match.index) | |
| 37 | - .replace(/[\s\S]*?<div id="toc">\s*<h2>.*?<\/h2>\s*(<ul>\s*)?/, ''); | ||
| 37 | + .replace(/[\s\S]*?id="toc"[^>]*>\s*<\w+>.*?<\/\w+>\s*(<ul>\s*)?/, ''); | ||
| 38 | 38 | ||
| 39 | 39 | apicontent += data.slice(match.index + match[0].length) | |
| 40 | 40 | .replace(/<!-- API END -->[\s\S]*/, '') | |
@@ -59,13 +59,13 @@ let all = toc.replace(/index\.html/g, 'all.html') | |||
| 59 | 59 | all = all.replace(/<title>.*?\| /, '<title>'); | |
| 60 | 60 | ||
| 61 | 61 | // Insert the combined table of contents. | |
| 62 | - const tocStart = /<div id="toc">\s*<h2>.*?<\/h2>\s*/.exec(all); | ||
| 62 | + const tocStart = /<\w+ id="toc"[^>]*>\s*<\w+>.*?<\/\w+>\s*/.exec(all); | ||
| 63 | 63 | all = all.slice(0, tocStart.index + tocStart[0].length) + | |
| 64 | 64 | '<ul>\n' + contents + '</ul>\n' + | |
| 65 | 65 | all.slice(tocStart.index + tocStart[0].length); | |
| 66 | 66 | ||
| 67 | 67 | // Replace apicontent with the concatenated set of apicontents from each source. | |
| 68 | - const apiStart = /<div id="apicontent">\s*/.exec(all); | ||
| 68 | + const apiStart = /<\w+ id="apicontent">\s*/.exec(all); | ||
| 69 | 69 | const apiEnd = all.lastIndexOf('<!-- API END -->'); | |
| 70 | 70 | all = all.slice(0, apiStart.index + apiStart[0].length) + | |
| 71 | 71 | apicontent + | |
| Back | FazBrowse Home | New Git URL |
0 commit comments