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.
This commit is contained in:
jeffreytse 2021-05-27 11:03:50 +08:00
parent c5212c60ad
commit 844aea6c74

View file

@ -1,6 +1,7 @@
<script>
function hashLocate(hashValue) {
hashValue = hashValue.replace(/^.*#h-/, '');
hashValue = decodeURIComponent(hashValue);
var element = document.getElementById(hashValue);
if (!element) {