mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 12:08:03 +08:00
strip out HTML headers during the import
This commit is contained in:
parent
a5e38165ef
commit
bf5a31dcdb
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue