From: Konrumi Date: Sun, 8 Mar 2020 05:07:34 +0000 (+0000) Subject: fix: decode anchor hash string to support Chinese characters X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0632d9ad3d0f9bc923b0496554f92732baa623fe;p=eg-antora.git fix: decode anchor hash string to support Chinese characters (cherry picked from commit 810652e445545efbf20a6a3e93ce4365ed534516) --- diff --git a/src/js/02-fragment-jumper.js b/src/js/02-fragment-jumper.js index 186a193..e3b6ed5 100644 --- a/src/js/02-fragment-jumper.js +++ b/src/js/02-fragment-jumper.js @@ -31,7 +31,7 @@ Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]')).forEach(function (el) { var hash, target - if ((hash = el.hash.slice(1)) && (target = document.getElementById(hash))) { + if ((hash = decodeURIComponent(el.hash.slice(1))) && (target = document.getElementById(hash))) { el.addEventListener('click', jumpToAnchor.bind(target)) } })