From 9bce57279aa9d3b828f33d7f982d196af32b364b Mon Sep 17 00:00:00 2001 From: Celeste Date: Sat, 16 Nov 2024 23:57:23 +0100 Subject: [PATCH] An extremely simple fix to decode special characters --- layouts/404.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/404.html b/layouts/404.html index 98f4a67..d81000e 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -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); {{- end -}} {{ partialCached "footer/footer" . }} -{{ end }} \ No newline at end of file +{{ end }}