diff --git a/src/services/import/tar.js b/src/services/import/tar.js index dfb12f6f3..020ef4321 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>/g, (match, text) => { + content = content.replace(/]*>/gis, ""); + content = content.replace(/<\/body>.*<\/html>/gis, ""); + + content = content.replace(/

([^<]*)<\/h1>/gi, (match, text) => { if (noteTitle.trim() === text.trim()) { return ""; // remove whole H1 tag }