mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
strip out HTML headers during the import
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user