Skip to content

Build your personal knowledge base with Trilium Notes

test(commons): drop the unreachable fallback in parseMindMapNoteLink

Elian Doran4c0f01ec912a
diff --git a/packages/commons/src/lib/notes.ts b/packages/commons/src/lib/notes.ts
index aa2cb84110..9438f529cd 100644
--- a/packages/commons/src/lib/notes.ts
+++ b/packages/commons/src/lib/notes.ts
@@ -71,9 +71,10 @@ export function parseMindMapNoteLink(link: unknown): { notePath: string; noteId:
}
const notePath = link.slice(1);
+ const segments = notePath.split("/");
return {
notePath,
- noteId: notePath.split("/").at(-1) ?? notePath
+ noteId: segments[segments.length - 1]
};
}