From bf5a31dcdbb501503b2d100165cccb64c2229732 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 31 Aug 2019 22:52:07 +0200 Subject: [PATCH] strip out HTML headers during the import --- src/services/import/tar.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }