This commit is contained in:
2026-01-28 00:30:36 +01:00
parent a7a936fac2
commit 779f3adb45
3 changed files with 17 additions and 50 deletions

View File

@@ -173,31 +173,6 @@
const isText = (component.is && component.is('text'))
|| (component.get && component.get('type') === 'text');
try {
if (isText && component.components) {
try {
const comps = component.components();
if (comps && comps.reset) comps.reset();
} catch {}
try {
const wrapper = document.createElement('div');
wrapper.innerHTML = content;
const newComps = [];
wrapper.childNodes.forEach((node) => {
if (node.nodeType === 3) {
const text = node.textContent || '';
newComps.push({ type: 'textnode', content: text });
} else if (node.nodeType === 1) {
const tag = node.tagName ? node.tagName.toLowerCase() : '';
if (tag === 'br') {
newComps.push({ tagName: 'br', void: true });
} else {
newComps.push(node.outerHTML);
}
}
});
component.components(newComps.length ? newComps : content);
} catch {}
}
if (component.set) component.set('content', content);
} catch {}
if (component.view && typeof component.view.render === 'function') {