Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Merge remote-tracking branch 'origin/master' into next60
zadamcc02546ed36c
diff --cc src/public/app/widgets/type_widgets/content_widget.jsindex 627612d6c9,967c996e5b..694e16dabe--- a/src/public/app/widgets/type_widgets/content_widget.js+++ b/src/public/app/widgets/type_widgets/content_widget.js@@@ -76,9 -76,9 +77,10 @@@ const CONTENT_WIDGETS =_optionsBackup: [ BackupOptions ],_optionsSync: [ SyncOptions ],_optionsOther: [+ SearchEngineOptions,TrayOptions,NoteErasureTimeoutOptions,+ AttachmentErasureTimeoutOptions,NoteRevisionsSnapshotIntervalOptions,NetworkConnectionsOptions],diff --cc src/routes/api/options.jsindex 89a02d726b,e98b1795f1..201d4e2668--- a/src/routes/api/options.js+++ b/src/routes/api/options.js@@@ -62,7 -62,8 +62,10 @@@ const ALLOWED_OPTIONS = new Set('minTocHeadings','checkForUpdates','disableTray',- 'eraseUnusedImageAttachmentsAfterSeconds'++ 'eraseUnusedImageAttachmentsAfterSeconds',++ 'disableTray',+ 'customSearchEngineName',+ 'customSearchEngineUrl',]);function getOptions() {diff --cc src/services/export/zip.jsindex 88da1c8b81,1bc73f7681..a64bbe2c39--- a/src/services/export/zip.js+++ b/src/services/export/zip.js@@@ -501,10 -414,10 +503,10 @@@ ${markdownContent}`}const existingFileNames = format === 'html' ? ['navigation', 'index'] : [];- const rootMeta = getNoteMeta(branch, { notePath: [] }, existingFileNames);+ const rootMeta = createNoteMeta(branch, { notePath: [] }, existingFileNames);const metaFile = {- formatVersion: 1,+ formatVersion: 2,appVersion: packageInfo.version,files: [ rootMeta ]};diff --cc src/services/import/zip.jsindex 301f681632,74a9421136..1d61aa8dec--- a/src/services/import/zip.js+++ b/src/services/import/zip.js@@@ -403,15 -327,18 +405,27 @@@ async function importZip(taskContext, freturn content;}+ function removeTrilumTags(content) {+ const tagsToRemove = [+ '<h1 data-trilium-h1>([^<]*)<\/h1>',+ '<title data-trilium-title>([^<]*)<\/title>'+ ]- for (const tag of tagsToRemove) {++ for (const tag of tagsToRemove) {+ let re = new RegExp(tag, "gi");+ content = content.replace(re, '');+ }+ return content;+ }++ /**+ * @param {NoteMeta} noteMeta+ * @param {string} type+ * @param {string} mime+ * @param {string|Buffer} content+ * @param {string} noteTitle+ * @param {string} filePath+ * @return {string}+ */function processNoteContent(noteMeta, type, mime, content, noteTitle, filePath) {if (noteMeta?.format === 'markdown'|| (!noteMeta && taskContext.data.textImportedAsText && ['text/markdown', 'text/x-markdown'].includes(mime))) {diff --cc src/services/options_init.jsindex be9dcdc917,1ce5bbd5dd..f97813d283--- a/src/services/options_init.js+++ b/src/services/options_init.js@@@ -88,7 -89,8 +88,9 @@@ const defaultOptions ={ name: 'minTocHeadings', value: '5', isSynced: true },{ name: 'checkForUpdates', value: 'true', isSynced: true },{ name: 'disableTray', value: 'false', isSynced: false },+ { name: 'eraseUnusedImageAttachmentsAfterSeconds', value: '86400', isSynced: false },+ { name: 'customSearchEngineName', value: 'Duckduckgo', isSynced: false },+ { name: 'customSearchEngineUrl', value: 'https://duckduckgo.com/?q={keyword}', isSynced: false },];function initStartupOptions() {