diff --git a/src/components/RevealManager.tsx b/src/components/RevealManager.tsx index 496ed5a..ad8ecea 100644 --- a/src/components/RevealManager.tsx +++ b/src/components/RevealManager.tsx @@ -101,7 +101,7 @@ export const RevealManager: Component = () => { const state = journalStreamState; if (!dom || state.myRole !== "gm" || !state.connected) return; - const normalized = normalizePath(location.pathname); + const normalized = normalizePath(decodeURIComponent(location.pathname)); const data = comp.data; // Spark tables on this page — matched by suffix on column slug. diff --git a/src/components/journal/types/link.tsx b/src/components/journal/types/link.tsx index c1d7238..a2c5f5a 100644 --- a/src/components/journal/types/link.tsx +++ b/src/components/journal/types/link.tsx @@ -27,7 +27,8 @@ function fileNameFromPath(path: string): string { /** Encode a path, preserving / separators but encoding each segment */ function encodePath(path: string): string { - return path + // Decode first in case the path is already URL-encoded (defense-in-depth) + return decodeURIComponent(path) .split("/") .map((seg) => encodeURIComponent(seg)) .join("/");