borrar <script> y <style>
This commit is contained in:
parent
792047d4c8
commit
570752edec
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue