An extremely simple fix to decode special characters

This commit is contained in:
Celeste 2024-11-16 23:57:23 +01:00 committed by GitHub
parent 839fbd0ecb
commit 9bce57279a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,10 +36,10 @@
const wrongUrl = new URL(window.location.href);
/// Get the search keyword from the wrong URL by removing all slashes and dashes
const searchKeyword = wrongUrl.pathname.split(/[/|-]/).join(' ').trim();
const searchKeyword = decodeURIComponent(wrongUrl.pathname).split(/[/|-]/).join(' ').trim();
document.getElementById('searchInput').setAttribute('value', searchKeyword);
</script>
{{- end -}}
{{ partialCached "footer/footer" . }}
{{ end }}
{{ end }}