diff --git a/src/core/event/sidebar.js b/src/core/event/sidebar.js index b15cb2afe..7ca72d94c 100644 --- a/src/core/event/sidebar.js +++ b/src/core/event/sidebar.js @@ -86,6 +86,8 @@ export function getAndActive(router, el, isParent, autoTitle) { const href = a.getAttribute('href'); const node = isParent ? a.parentNode : a; + a.title = a.innerText; + if (hash.indexOf(href) === 0 && !target) { target = a; dom.toggleClass(node, 'add', 'active'); diff --git a/src/core/render/tpl.js b/src/core/render/tpl.js index e3b35a5c3..2bad3a311 100644 --- a/src/core/render/tpl.js +++ b/src/core/render/tpl.js @@ -91,7 +91,7 @@ export function tree(toc, tpl = '
') { let innerHTML = ''; toc.forEach(node => { - innerHTML += `