mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Decode percent-escapes in OG card route segments
This commit is contained in:
@@ -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" };
|
||||
|
||||
Reference in New Issue
Block a user