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:
parent
c5212c60ad
commit
844aea6c74
|
@ -1,6 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
function hashLocate(hashValue) {
|
function hashLocate(hashValue) {
|
||||||
hashValue = hashValue.replace(/^.*#h-/, '');
|
hashValue = hashValue.replace(/^.*#h-/, '');
|
||||||
|
hashValue = decodeURIComponent(hashValue);
|
||||||
var element = document.getElementById(hashValue);
|
var element = document.getElementById(hashValue);
|
||||||
|
|
||||||
if (!element) {
|
if (!element) {
|
||||||
|
|
Loading…
Reference in a new issue