Skip to content
Permalink
Browse files

feat($toc): push branch node when the depth of last node is 1

  • Loading branch information...
ulivz committed Feb 7, 2019
1 parent ef2cb19 commit 8809986dda2b0f43ace2233c1ba0ce9a69d8ceab
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/toc.js
@@ -42,7 +42,11 @@ function getSidebarByToc(toc) {
pushLeaf(cur, stack)
} else {
stack.pop()
pushLeaf(cur, stack)
if (cur.depth === 1) {
pushBranch(cur, stack)
} else {
pushLeaf(cur, stack)
}
}

} else {

0 comments on commit 8809986

Please sign in to comment.
You can’t perform that action at this time.