mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 19:20:06 +08:00
fix(render): Toc rendering error, fixed #106
This commit is contained in:
parent
0aead898eb
commit
0d59ee939f
@ -106,8 +106,9 @@ export function sidebar (text, level) {
|
||||
html = markdown(text)
|
||||
html = html.match(/<ul[^>]*>([\s\S]+)<\/ul>/g)[0]
|
||||
} else {
|
||||
const tree = genTree(toc, level)
|
||||
const tree = cacheTree[currentPath] || genTree(toc, level)
|
||||
html = treeTpl(tree, '<ul>')
|
||||
cacheTree[currentPath] = tree
|
||||
}
|
||||
|
||||
return html
|
||||
|
@ -75,7 +75,7 @@ export function renderMixin (proto) {
|
||||
|
||||
this._renderTo('.sidebar-nav', sidebar(text, maxLevel))
|
||||
const active = getAndActive('.sidebar-nav', true, true)
|
||||
loadSidebar && subSidebar(active, subMaxLevel)
|
||||
subSidebar(loadSidebar ? active : '', subMaxLevel)
|
||||
// bind event
|
||||
this.activeLink = active
|
||||
scrollActiveSidebar()
|
||||
|
Loading…
Reference in New Issue
Block a user