mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 05:16:06 +10:00
Updated to remove all headers under it
This commit is contained in:
committed by
Anton Wilhelm
parent
6cc069cb9f
commit
78f5564a30
@@ -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>')
|
||||
|
||||
Reference in New Issue
Block a user