Skip to content

Commit f6b9ab5

Browse files
authored
Decode Markdown filename URIs in preview (#964)
1 parent ff6a1be commit f6b9ab5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ function handleWatch(socket: WebSocket, req: IncomingMessage, {root, style}: Con
357357

358358
async function hello({path: initialPath, hash: initialHash}: {path: string; hash: string}): Promise<void> {
359359
if (markdownWatcher || attachmentWatcher) throw new Error("already watching");
360-
path = initialPath;
360+
path = decodeURIComponent(initialPath);
361361
if (!(path = normalize(path)).startsWith("/")) throw new Error("Invalid path: " + initialPath);
362362
if (path.endsWith("/")) path += "index";
363363
path += ".md";

0 commit comments

Comments
 (0)