Skip to content

Commit d47010a

Browse files
committed
fix: #1476
1 parent 58f31ed commit d47010a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/str.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export function formatPath(path: string, suffix: string = "") {
2626
path = Zotero.File.normalizeToUnix(path);
2727
if (Zotero.isWin) {
2828
path = path.replace(/\//g, "\\");
29+
30+
if (path[0] === "\\" && path[1] !== "\\") {
31+
// Assume it's an UNC path wrongly formatted, e.g. `\wsl.localhost\...` from pathHelper
32+
path = `\\${path}`;
33+
}
34+
return path;
2935
}
3036
if (suffix && !path.endsWith(suffix)) {
3137
path += suffix;

0 commit comments

Comments
 (0)