editor: mantener text nodes solo cuando tienen texto
This commit is contained in:
parent
117fa84cc4
commit
2d8507369b
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ export function getValidChildren (node: Element, type: EditorNode): Node[] {
|
|||
return [...node.childNodes].filter(n => {
|
||||
// si permite texto y esto es un texto, es válido
|
||||
if (n.nodeType === Node.TEXT_NODE)
|
||||
return type.allowedChildren.includes('text')
|
||||
return type.allowedChildren.includes('text') && n.textContent?.length
|
||||
|
||||
// si no es un elemento, no es válido
|
||||
if (!(n instanceof Element))
|
||||
|
|
Loading…
Reference in a new issue