LinkResolver: Handle strange path

Fixes APP-P8
This commit is contained in:
Vishesh Handa
2021-01-23 06:53:03 +01:00
parent 76c0ec6503
commit 6761d6a4e5

View File

@ -15,10 +15,15 @@ class LinkResolver {
}
var rootFolder = inputNote.parent.rootFolder;
assert(l.filePath.startsWith(rootFolder.folderPath));
var spec = l.filePath.substring(rootFolder.folderPath.length + 1);
if (l.filePath.startsWith(rootFolder.folderPath)) {
var spec = l.filePath.substring(rootFolder.folderPath.length);
if (spec.startsWith('/')) {
spec = spec.substring(1);
}
return _getNoteWithSpec(rootFolder, spec);
}
return _getNoteWithSpec(rootFolder, spec);
return null;
}
Note resolve(String link) {