ssadsa
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user