| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5d3a4ad commit 25dd8f6
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -472,6 +472,9 @@ function getSection(lexed) { | |||
| 472 | 472 | return ''; | |
| 473 | 473 | } | |
| 474 | 474 | ||
| 475 | + function getMark(anchor) { | ||
| 476 | + return `<span><a class="mark" href="#${anchor}" id="${anchor}">#</a></span>`; | ||
| 477 | + } | ||
| 475 | 478 | ||
| 476 | 479 | function buildToc(lexed, filename, cb) { | |
| 477 | 480 | var toc = []; | |
@@ -499,12 +502,15 @@ function buildToc(lexed, filename, cb) { | |||
| 499 | 502 | ||
| 500 | 503 | depth = tok.depth; | |
| 501 | 504 | const realFilename = path.basename(realFilenames[0], '.md'); | |
| 502 | - const id = getId(`${realFilename}_${tok.text.trim()}`); | ||
| 505 | + const apiName = tok.text.trim(); | ||
| 506 | + const id = getId(`${realFilename}_${apiName}`); | ||
| 503 | 507 | toc.push(new Array((depth - 1) * 2 + 1).join(' ') + | |
| 504 | 508 | `* <span class="stability_${tok.stability}">` + | |
| 505 | 509 | `<a href="#${id}">${tok.text}</a></span>`); | |
| 506 | - tok.text += `<span><a class="mark" href="#${id}"` + | ||
| 507 | - `id="${id}">#</a></span>`; | ||
| 510 | + tok.text += getMark(id); | ||
| 511 | + if (realFilename === 'errors' && apiName.startsWith('ERR_')) { | ||
| 512 | + tok.text += getMark(apiName); | ||
| 513 | + } | ||
| 508 | 514 | }); | |
| 509 | 515 | ||
| 510 | 516 | toc = marked.parse(toc.join('\n')); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments