Skip to content

Build your personal knowledge base with Trilium Notes

fix ZIP import of notes with included note

zadamc063f75f48f8
diff --git a/db/demo.zip b/db/demo.zip
index 4b7cfed50c..4de7753a34 100644
Binary files a/db/demo.zip and b/db/demo.zip differ
diff --git a/src/services/import/zip.js b/src/services/import/zip.js
index 951ccb3063..cb49291654 100644
--- a/src/services/import/zip.js
+++ b/src/services/import/zip.js
@@ -317,6 +317,14 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
return match;
}
});
+
+ const includeNoteLinks = (noteMeta.attributes || [])
+ .filter(attr => attr.type === 'relation' && attr.name === 'includeNoteLink');
+
+ for (const link of includeNoteLinks) {
+ // no need to escape the regexp find string since it's a noteId which doesn't contain any special characters
+ content = content.replace(new RegExp(link.value, "g"), getNewNoteId(link.value));
+ }
}
if (type === 'relation-map' && noteMeta) {