Fix Windows wiki-link/graph showing duplicate and old-version notes (path separators)

This commit is contained in:
Yuri Karamian
2026-06-07 18:55:12 +02:00
parent 7c94370e48
commit a28e514ed4
4 changed files with 34 additions and 25 deletions
+4 -2
View File
@@ -76,8 +76,10 @@
}
function getFolderKey(path: string): string {
const vaultRoot = $appConfig?.active_vault || '';
const rel = vaultRoot && path.startsWith(vaultRoot + '/') ? path.slice(vaultRoot.length + 1) : path;
// Normalize Windows backslashes so folder grouping/colours work there too.
const p = (path || '').replace(/\\/g, '/');
const vaultRoot = ($appConfig?.active_vault || '').replace(/\\/g, '/');
const rel = vaultRoot && p.startsWith(vaultRoot + '/') ? p.slice(vaultRoot.length + 1) : p;
const slash = rel.indexOf('/');
return slash >= 0 ? rel.slice(0, slash) : '';
}