| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 95e897e commit fa7d969
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -313,23 +313,11 @@ function versionSort(a, b) { | |||
| 313 | 313 | ||
| 314 | 314 | function buildToc({ filename, apilinks }) { | |
| 315 | 315 | return (tree, file) => { | |
| 316 | - const startIncludeRefRE = /^\s*<!-- \[start-include:(.+)\] -->\s*$/; | ||
| 317 | - const endIncludeRefRE = /^\s*<!-- \[end-include:.+\] -->\s*$/; | ||
| 318 | - const realFilenames = [filename]; | ||
| 319 | 316 | const idCounters = Object.create(null); | |
| 320 | 317 | let toc = ''; | |
| 321 | 318 | let depth = 0; | |
| 322 | 319 | ||
| 323 | 320 | visit(tree, null, (node) => { | |
| 324 | - // Keep track of the current filename for comment wrappers of inclusions. | ||
| 325 | - if (node.type === 'html') { | ||
| 326 | - const [, includedFileName] = node.value.match(startIncludeRefRE) || []; | ||
| 327 | - if (includedFileName !== undefined) | ||
| 328 | - realFilenames.unshift(includedFileName); | ||
| 329 | - else if (endIncludeRefRE.test(node.value)) | ||
| 330 | - realFilenames.shift(); | ||
| 331 | - } | ||
| 332 | - | ||
| 333 | 321 | if (node.type !== 'heading') return; | |
| 334 | 322 | ||
| 335 | 323 | if (node.depth - depth > 1) { | |
@@ -339,7 +327,7 @@ function buildToc({ filename, apilinks }) { | |||
| 339 | 327 | } | |
| 340 | 328 | ||
| 341 | 329 | depth = node.depth; | |
| 342 | - const realFilename = path.basename(realFilenames[0], '.md'); | ||
| 330 | + const realFilename = path.basename(filename, '.md'); | ||
| 343 | 331 | const headingText = file.contents.slice( | |
| 344 | 332 | node.children[0].position.start.offset, | |
| 345 | 333 | node.position.end.offset).trim(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments