diff --git a/app/javascript/editor/editor.js b/app/javascript/editor/editor.js index 92ae14dd..a52f9c8e 100644 --- a/app/javascript/editor/editor.js +++ b/app/javascript/editor/editor.js @@ -265,7 +265,10 @@ const cleanContent = (contentEl) => { if (elementIsParentBlock(child)) { cleanContent(child) } else if (!elementIsBlock(child)) { - child.tagName = "P" + const el = document.createElement("p") + moveChildren(child, el, null) + contentEl.insertBefore(el, child) + child.parentNode.removeChild(child) } } else if (child.nodeType === Node.TEXT_NODE) { const el = document.createElement("p")