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
strip out HTML headers during the import
zadambf5a31dcdbb5
diff --git a/src/services/import/tar.js b/src/services/import/tar.jsindex dfb12f6f37..020ef4321c 100644--- a/src/services/import/tar.js+++ b/src/services/import/tar.js@@ -304,7 +304,10 @@ async function importTar(importContext, fileBuffer, importRootNote) {return `href="#root/${targetNoteId}"`;});- content = content.replace(/<h1>([^<]*)<\/h1>/g, (match, text) => {+ content = content.replace(/<html.*<body[^>]*>/gis, "");+ content = content.replace(/<\/body>.*<\/html>/gis, "");++ content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => {if (noteTitle.trim() === text.trim()) {return ""; // remove whole H1 tag}