From 4aa0b200b9ea1b2f906acad5d5a043f72979f069 Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Mon, 20 Jul 2026 02:47:11 +0200 Subject: [PATCH] Fix Windows relative image resolution (#215) --- src/lib/components/Editor.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/Editor.svelte b/src/lib/components/Editor.svelte index 62d98ae..0143693 100644 --- a/src/lib/components/Editor.svelte +++ b/src/lib/components/Editor.svelte @@ -2793,7 +2793,8 @@ // Standard markdown: resolve relative paths against the note's directory const notePath = $activeNotePath; if (notePath) { - const noteDir = notePath.substring(0, notePath.lastIndexOf('/')); + const normalizedNotePath = notePath.replace(/\\/g, '/'); + const noteDir = normalizedNotePath.substring(0, normalizedNotePath.lastIndexOf('/')); return convertFileSrc(normalizePath(`${noteDir}/${decoded}`)); } // Last fallback: vault root