mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
strip out HTML headers during the import
This commit is contained in:
parent
a5e38165ef
commit
bf5a31dcdb
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user