Skip to content

Commit df65578

Browse files
Alex-Sokolovchrisvfritz
authored andcommitted
Fix: changing hash on load if contains non-ASCII chars (vuejs#709)
* Fix: add decode hash with non-ASCII chars * Fix indentation * Removed spaces
1 parent 8c9f1a4 commit df65578

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

themes/vue/source/js/common.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
}
3636

3737
function initLocationHashFuzzyMatching () {
38-
var hash = window.location.hash
38+
var hash;
39+
try {
40+
hash = escapeCharacters(decodeURIComponent(window.location.hash))
41+
} catch(e) {
42+
hash = escapeCharacters(window.location.hash)
43+
}
3944
if (!hash) return
4045
var hashTarget = document.getElementById(hash)
4146
if (!hashTarget) {

0 commit comments

Comments
 (0)