Decode percent-escapes in OG card route segments

This commit is contained in:
Rūdolfs Ošiņš
2026-05-06 10:57:21 +02:00
parent 3f798744bb
commit 9e669eaf05
+10 -1
View File
@@ -38,7 +38,16 @@ function ensureInit() {
}
function parseRoute(pathname) {
const segments = pathname.replace(/^\//, "").split("/");
const segments = pathname
.replace(/^\//, "")
.split("/")
.map(s => {
try {
return decodeURIComponent(s);
} catch {
return s;
}
});
const first = segments[0];
if (first === "" || first === undefined) return { type: "home" };