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:
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}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user