diff --git a/src/core/event/scroll.js b/src/core/event/scroll.js index 2a3b16cae..257559b11 100644 --- a/src/core/event/scroll.js +++ b/src/core/event/scroll.js @@ -1,7 +1,7 @@ -import { isMobile } from '../util/env'; -import * as dom from '../util/dom'; import Tweezer from 'tweezer.js'; import cssEscape from 'css.escape'; +import { isMobile } from '../util/env'; +import * as dom from '../util/dom'; const nav = {}; let hoverOver = false; @@ -146,7 +146,7 @@ export function scrollIntoView(path, id) { const section = dom.find('#' + cssEscape(id)); section && scrollTo(section); - const li = nav[getNavKey(path, id)]; + const li = nav[decodeURIComponent(getNavKey(path, id))]; const sidebar = dom.getNode('.sidebar'); const active = dom.find(sidebar, 'li.active'); active && active.classList.remove('active'); diff --git a/src/core/event/sidebar.js b/src/core/event/sidebar.js index f252f2b48..14a5aa8a4 100644 --- a/src/core/event/sidebar.js +++ b/src/core/event/sidebar.js @@ -82,7 +82,7 @@ export function getAndActive(router, el, isParent, autoTitle) { links .sort((a, b) => b.href.length - a.href.length) .forEach(a => { - const href = a.getAttribute('href'); + const href = decodeURI(a.getAttribute('href')); const node = isParent ? a.parentNode : a; if (hash.indexOf(href) === 0 && !target) {