diff --git a/app/javascript/editor/editor.ts b/app/javascript/editor/editor.ts index ba2403b..a36634e 100644 --- a/app/javascript/editor/editor.ts +++ b/app/javascript/editor/editor.ts @@ -22,6 +22,11 @@ export interface Editor { // Lo hace para que siga la estructura del documento y que no se borren por // cleanContent luego. function fixContent (editor: Editor, node: Element = editor.contentEl): void { + if (node.tagName === 'SCRIPT' || node.tagName === 'STYLE') { + node.parentElement?.removeChild(node) + return + } + if (node.tagName === 'I') { const el = document.createElement('em') moveChildren(node, el, null)