From e87991af48cb31e5daf796bd4ac90fb358a65a2d Mon Sep 17 00:00:00 2001 From: void Date: Tue, 2 Feb 2021 19:48:47 +0000 Subject: [PATCH] editor: tagName no es un setter! --- app/javascript/editor/editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/editor/editor.js b/app/javascript/editor/editor.js index 24c0f346..8f732f37 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")