fix: normalize Windows paths to forward slashes for Typst

Fixes Windows "syntax error" (OS error 123) when template paths
contain backslashes. Typst interprets backslashes as escape
characters, causing invalid filename syntax errors.

Now converts all template paths to use forward slashes before
passing to Typst via variables. Typst accepts forward slashes
on all platforms including Windows.

Fixes: #10

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-11-09 22:20:23 +01:00
1 parent b322e6801c
commit cf4de4ce36
1 file changed
+4
@@ -311,6 +311,10 @@ export class PandocCommandBuilder {
templatePathForTypst = path.relative(pandocOptions.vaultBasePath, templatePathForTypst); templatePathForTypst = path.relative(pandocOptions.vaultBasePath, templatePathForTypst);
} }
// Normalize to forward slashes for Typst (Typst uses forward slashes on all platforms)
// This prevents Windows backslashes from being interpreted as escape characters in Typst
templatePathForTypst = templatePathForTypst.replace(/\\/g, '/');
args.push('-V', `template_path=${templatePathForTypst}`); args.push('-V', `template_path=${templatePathForTypst}`);
} }
} }