aboutsummaryrefslogtreecommitdiff
path: root/frontend/index.ts
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-06 19:15:43 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-06 19:15:43 +0200
commit412a77b7c1ba1819f4bf1c0697ddd19d7af21e19 (patch)
tree911f3b54bc4bf05f7cfb819c31a08219e7b5ac59 /frontend/index.ts
parent2aedff3d2bbdcad93d6ca0ec883c446c703cafaa (diff)
fix(frontend): malformed title and quote after hot update
Diffstat (limited to 'frontend/index.ts')
-rw-r--r--frontend/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/index.ts b/frontend/index.ts
index 1d87f0a..a00854f 100644
--- a/frontend/index.ts
+++ b/frontend/index.ts
@@ -21,10 +21,10 @@ function setupAnchors() {
document.addEventListener("htmx:afterSettle", e => {
if (e.detail.xhr === undefined) return
const title = e.detail.xhr.getResponseHeader("Updated-Title")
- if (title?.length !== 0) document.title = title
+ if (title?.length !== 0) document.title = decodeURIComponent(title).replaceAll("+", " ")
const quote = e.detail.xhr.getResponseHeader("Updated-Quote")
if (quote?.length !== 0)
- document.querySelector("#quote")!.innerHTML = "«&thinsp;" + quote + "&thinsp;»"
+ document.querySelector("#quote")!.innerHTML = "«&thinsp;" + decodeURIComponent(quote).replaceAll("+", " ") + "&thinsp;»"
setupAnchors()
})