projects
/
eg-antora.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cdc5f6c
)
fix: decode anchor hash string to support Chinese characters
author
Konrumi
<konrumi@gmail.com>
Sun, 8 Mar 2020 05:07:34 +0000
(
05:07
+0000)
committer
Dan Allen
<dan@opendevise.com>
Wed, 18 Mar 2020 22:19:17 +0000
(22:19 +0000)
(cherry picked from commit
810652e445545efbf20a6a3e93ce4365ed534516
)
src/js/02-fragment-jumper.js
patch
|
blob
|
history
diff --git
a/src/js/02-fragment-jumper.js
b/src/js/02-fragment-jumper.js
index
186a193
..
e3b6ed5
100644
(file)
--- 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))
}
})