This commit is contained in:
2026-01-11 23:09:13 +01:00
parent 0fdd0b7f03
commit 68e744788d

View File

@@ -340,25 +340,11 @@
return type === 'text' || type === 'link' || type === 'button';
};
const modelHasContent = (cmp) => {
if (!cmp) return false;
if (typeof cmp.components === 'function') {
const comps = cmp.components();
if (comps && comps.length) return true;
}
if (typeof cmp.get === 'function') {
const content = cmp.get('content');
if (typeof content === 'string' && content !== '') return true;
}
return false;
};
const fixPlainTextContent = (cmp) => {
if (!cmp || !cmp.view || !cmp.view.el) return;
if (!isTextLike(cmp)) return;
const el = cmp.view.el;
if (!hasPlainTextNodes(el)) return;
if (modelHasContent(cmp)) return;
const comps = buildTextnodeComponents(el);
if (!comps.length) return;
try {