diff options
author | jeffreytse <jeffreytse.mail@gmail.com> | 2021-05-27 11:03:50 +0800 |
---|---|---|
committer | jeffreytse <jeffreytse.mail@gmail.com> | 2021-05-27 11:03:50 +0800 |
commit | 844aea6c74803daedaaecea44f152121e2165e19 (patch) | |
tree | ea8cc1b1aaa38ec9aae9fffad5d91b2a398484f8 | |
parent | c5212c60ad8058732c17b3107ffd1b6a05850bd4 (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.html | 1 |
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) { |