summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeffreytse <jeffreytse.mail@gmail.com>2021-05-27 11:03:50 +0800
committerjeffreytse <jeffreytse.mail@gmail.com>2021-05-27 11:03:50 +0800
commit844aea6c74803daedaaecea44f152121e2165e19 (patch)
treeea8cc1b1aaa38ec9aae9fffad5d91b2a398484f8
parentc5212c60ad8058732c17b3107ffd1b6a05850bd4 (diff)
fix: hash locating of cjk heading isn't working (#44)
When the heading includes CJK (Chinese, Japanese, Korean) characters, the hash locating isn't working correctly, the page will not automatically scroll to the corresponding heading.
-rw-r--r--_includes/extensions/hashlocate.html1
1 files changed, 1 insertions, 0 deletions
diff --git a/_includes/extensions/hashlocate.html b/_includes/extensions/hashlocate.html
index fd4a3d6..0f3e29e 100644
--- a/_includes/extensions/hashlocate.html
+++ b/_includes/extensions/hashlocate.html
@@ -1,6 +1,7 @@
<script>
function hashLocate(hashValue) {
hashValue = hashValue.replace(/^.*#h-/, '');
+ hashValue = decodeURIComponent(hashValue);
var element = document.getElementById(hashValue);
if (!element) {