Skip to content

Build your personal knowledge base with Trilium Notes

sort children during export to ensure a more stable format

Sylvain Paschecb523faaadbd
diff --git a/src/services/export/zip.js b/src/services/export/zip.js
index 0e6b11e46a..dba7338d30 100644
--- a/src/services/export/zip.js
+++ b/src/services/export/zip.js
@@ -181,6 +181,8 @@ async function exportToZip(taskContext, branch, format, res, setHeaders = true)
noteIdToMeta[note.noteId] = meta;
+ // sort children for having a stable / reproducible export format
+ note.sortChildren();
const childBranches = note.getChildBranches()
.filter(branch => branch.noteId !== '_hidden');