diff --git a/app/assets/javascripts/02-editor.js b/app/assets/javascripts/02-editor.js index e01132ef..87d47758 100644 --- a/app/assets/javascripts/02-editor.js +++ b/app/assets/javascripts/02-editor.js @@ -336,8 +336,17 @@ function cleanNode (node, contentEl) { child.parentElement.removeChild(child) return } else if (child.tagName === "STYLE") { + return child.parentElement.removeChild(child) + } else if (child.tagName === "B") { + const el = document.createElement("STRONG") + moveChildren(child, el) + child.parentElement.insertBefore(el, child) + child.parentElement.removeChild(child) + } else if (child.tagName === "I") { + const el = document.createElement("EM") + moveChildren(child, el) + child.parentElement.insertBefore(el, child) child.parentElement.removeChild(child) - return } for (const style of Object.values(child.style)) {