percent-decode hash

This commit is contained in:
Rhiannon Morris 2020-09-22 19:12:18 +02:00
parent 9b2e2f1cd4
commit 8b32dfb6b9
2 changed files with 2 additions and 2 deletions

View file

@ -86,7 +86,7 @@ function makeFragment() {
}
function useFragment() {
let frag = location.hash.replace(/^#/, '');
let frag = decodeURIComponent(location.hash).replace(/^#/, '');
if (frag == 'all' || !frag) {
clearForm();

View file

@ -60,7 +60,7 @@ function activateButton(button, doPush = true, firstLoad = false) {
function useFragment(firstLoad = false) {
let button = altButtons[0];
let frag = location.hash.replace(/^#/, '');
let frag = decodeURIComponent(location.hash).replace(/^#/, '');
if (frag) {
let selected = document.getElementById(frag);
if (selected) button = selected;