fix: {docsify-ignore-all} and {docsify-ignore} bug (#299)

* fix {docsify-ignore-all} not work bug

* fix {docsify-ignore} bug
This commit is contained in:
Li Xueli 2017-10-31 21:19:48 +08:00 committed by cinwell.li
commit cc98f56cdd
2 changed files with 7 additions and 6 deletions

View file

@ -191,11 +191,12 @@ export class Compiler {
const currentPath = this.router.getCurrentPath()
const { cacheTree, toc } = this
toc[0] && toc[0].ignoreAllSubs && (this.toc = [])
toc[0] && toc[0].ignoreAllSubs && toc.splice(0)
toc[0] && toc[0].level === 1 && toc.shift()
toc.forEach((node, i) => {
node.ignoreSubHeading && toc.splice(i, 1)
})
for (let i = 0; i < toc.length; i++) {
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
}
const tree = cacheTree[currentPath] || genTree(toc, level)