mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix import with style.css
This commit is contained in:
parent
73c8d145fa
commit
4cb511bad0
@ -274,6 +274,9 @@ async function importTar(taskContext, fileBuffer, importRootNote) {
|
|||||||
return /^(?:[a-z]+:)?\/\//i.test(url);
|
return /^(?:[a-z]+:)?\/\//i.test(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content = content.replace(/<html.*<body[^>]*>/gis, "");
|
||||||
|
content = content.replace(/<\/body>.*<\/html>/gis, "");
|
||||||
|
|
||||||
content = content.replace(/src="([^"]*)"/g, (match, url) => {
|
content = content.replace(/src="([^"]*)"/g, (match, url) => {
|
||||||
url = decodeURIComponent(url);
|
url = decodeURIComponent(url);
|
||||||
|
|
||||||
@ -298,9 +301,6 @@ async function importTar(taskContext, fileBuffer, importRootNote) {
|
|||||||
return `href="#root/${targetNoteId}"`;
|
return `href="#root/${targetNoteId}"`;
|
||||||
});
|
});
|
||||||
|
|
||||||
content = content.replace(/<html.*<body[^>]*>/gis, "");
|
|
||||||
content = content.replace(/<\/body>.*<\/html>/gis, "");
|
|
||||||
|
|
||||||
content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => {
|
content = content.replace(/<h1>([^<]*)<\/h1>/gi, (match, text) => {
|
||||||
if (noteTitle.trim() === text.trim()) {
|
if (noteTitle.trim() === text.trim()) {
|
||||||
return ""; // remove whole H1 tag
|
return ""; // remove whole H1 tag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user