mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix attributes leaking into imported notes, #241
This commit is contained in:
parent
c46f5805b1
commit
87aab7ac5b
@ -54,7 +54,11 @@ async function importEnex(file, parentNote) {
|
|||||||
function extractContent(enNote) {
|
function extractContent(enNote) {
|
||||||
// [] thing is workaround for https://github.com/Leonidas-from-XIV/node-xml2js/issues/484
|
// [] thing is workaround for https://github.com/Leonidas-from-XIV/node-xml2js/issues/484
|
||||||
let content = xmlBuilder.buildObject([enNote]);
|
let content = xmlBuilder.buildObject([enNote]);
|
||||||
content = content.substr(3, content.length - 7).trim();
|
|
||||||
|
const endOfFirstTagIndex = content.indexOf('>');
|
||||||
|
|
||||||
|
// strip the <0> and </0> tags
|
||||||
|
content = content.substr(endOfFirstTagIndex + 1, content.length - endOfFirstTagIndex - 5).trim();
|
||||||
|
|
||||||
// workaround for https://github.com/ckeditor/ckeditor5-list/issues/116
|
// workaround for https://github.com/ckeditor/ckeditor5-list/issues/116
|
||||||
content = content.replace(/<li>\s+<div>/g, "<li>");
|
content = content.replace(/<li>\s+<div>/g, "<li>");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user