strip out HTML headers during the import

This commit is contained in:
zadam 2019-08-31 22:52:07 +02:00
parent a5e38165ef
commit bf5a31dcdb

View file

@ -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
}