diff --git a/app/javascript/editor/types.ts b/app/javascript/editor/types.ts index 3c215a8..0e75081 100644 --- a/app/javascript/editor/types.ts +++ b/app/javascript/editor/types.ts @@ -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))