This commit is contained in:
2026-01-27 22:35:35 +01:00
parent c935e60028
commit cf051b421b
2 changed files with 18 additions and 2 deletions

View File

@@ -1 +1 @@
1.1.27 1.1.28

View File

@@ -179,7 +179,23 @@
if (comps && comps.reset) comps.reset(); if (comps && comps.reset) comps.reset();
} catch {} } catch {}
try { try {
component.components(content); const wrapper = document.createElement('div');
wrapper.innerHTML = content;
const newComps = [];
wrapper.childNodes.forEach((node) => {
if (node.nodeType === 3) {
const text = node.textContent || '';
if (text) 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 {} } catch {}
} }
if (component.set) component.set('content', content); if (component.set) component.set('content', content);