mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix: do not touch lists during migration
This commit is contained in:
@@ -94,12 +94,17 @@ function decodeWrappedTableHtml(html) {
|
||||
}
|
||||
|
||||
export function tinyToTiptap(html) {
|
||||
if (typeof html !== "string") return html;
|
||||
|
||||
const document = parseHTML(html);
|
||||
|
||||
const tables = document.querySelectorAll("table");
|
||||
for (const table of tables) {
|
||||
table.removeAttribute("contenteditable");
|
||||
if (table.parentElement?.nodeName.toLowerCase() === "div") {
|
||||
if (
|
||||
table.parentElement &&
|
||||
table.parentElement.nodeName.toLowerCase() === "div"
|
||||
) {
|
||||
table.parentElement.replaceWith(table);
|
||||
}
|
||||
}
|
||||
@@ -119,15 +124,6 @@ export function tinyToTiptap(html) {
|
||||
if (!p.childNodes.length) p.remove();
|
||||
}
|
||||
|
||||
const listItems = document.querySelectorAll("li");
|
||||
for (const li of listItems) {
|
||||
if (li.firstChild) {
|
||||
const p = document.createElement("p");
|
||||
p.appendChild(li.firstChild.cloneNode());
|
||||
li.firstChild.replaceWith(p);
|
||||
}
|
||||
}
|
||||
|
||||
const bogus = document.querySelectorAll("[data-mce-bogus]");
|
||||
for (const element of bogus) {
|
||||
element.remove();
|
||||
|
||||
Reference in New Issue
Block a user