mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 19:51:57 +08:00
Fix for Evernote workaround and support for en-todo (#1827)
This commit is contained in:
parent
5314446980
commit
1dfebdf6db
1 changed files with 14 additions and 10 deletions
|
@ -55,19 +55,23 @@ function importEnex(taskContext, file, parentNote) {
|
|||
content = content.trim();
|
||||
|
||||
// workaround for https://github.com/ckeditor/ckeditor5-list/issues/116
|
||||
content = content.replace(/<li>\s+<div>/g, "<li>");
|
||||
content = content.replace(/<\/div>\s+<\/li>/g, "</li>");
|
||||
content = content.replace(/<li>\s*<div>/g, "<li>");
|
||||
content = content.replace(/<\/div>\s*<\/li>/g, "</li>");
|
||||
|
||||
// workaround for https://github.com/ckeditor/ckeditor5-list/issues/115
|
||||
content = content.replace(/<ul>\s+<ul>/g, "<ul><li><ul>");
|
||||
content = content.replace(/<\/li>\s+<ul>/g, "<ul>");
|
||||
content = content.replace(/<\/ul>\s+<\/ul>/g, "</ul></li></ul>");
|
||||
content = content.replace(/<\/ul>\s+<li>/g, "</ul></li><li>");
|
||||
content = content.replace(/<ul>\s*<ul>/g, "<ul><li><ul>");
|
||||
content = content.replace(/<\/li>\s*<ul>/g, "<ul>");
|
||||
content = content.replace(/<\/ul>\s*<\/ul>/g, "</ul></li></ul>");
|
||||
content = content.replace(/<\/ul>\s*<li>/g, "</ul></li><li>");
|
||||
|
||||
content = content.replace(/<ol>\s+<ol>/g, "<ol><li><ol>");
|
||||
content = content.replace(/<\/li>\s+<ol>/g, "<ol>");
|
||||
content = content.replace(/<\/ol>\s+<\/ol>/g, "</ol></li></ol>");
|
||||
content = content.replace(/<\/ol>\s+<li>/g, "</ol></li><li>");
|
||||
content = content.replace(/<ol>\s*<ol>/g, "<ol><li><ol>");
|
||||
content = content.replace(/<\/li>\s*<ol>/g, "<ol>");
|
||||
content = content.replace(/<\/ol>\s*<\/ol>/g, "</ol></li></ol>");
|
||||
content = content.replace(/<\/ol>\s*<li>/g, "</ol></li><li>");
|
||||
|
||||
// Replace en-todo with unicode ballot box
|
||||
content = content.replace(/<en-todo\s+checked="true"\/>/g, "\u2611 ");
|
||||
content = content.replace(/<en-todo(\s+checked="false")?\/>/g, "\u2610 ");
|
||||
|
||||
content = htmlSanitizer.sanitize(content);
|
||||
|
||||
|
|
Loading…
Reference in a new issue