mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-02 20:20:30 +08: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…
Reference in New Issue
Block a user