mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
Updated to remove all headers under it
This commit is contained in:
parent
fd4a42c3b5
commit
72763398c3
@ -337,7 +337,15 @@ export class Compiler {
|
||||
html = this.compile(text)
|
||||
} else {
|
||||
for (let i = 0; i < toc.length; i++) {
|
||||
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
|
||||
if (toc[i].ignoreSubHeading) {
|
||||
const deletedHeaderLevel = toc[i].level
|
||||
toc.splice(i, 1)
|
||||
// Remove headers who are under current header
|
||||
for (let j = i; deletedHeaderLevel < toc[j].level && j < toc.length; j++) {
|
||||
toc.splice(j, 1) && j-- && i++
|
||||
}
|
||||
i--
|
||||
}
|
||||
}
|
||||
const tree = this.cacheTree[currentPath] || genTree(toc, level)
|
||||
html = treeTpl(tree, '<ul>{inner}</ul>')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user