This commit is contained in:
2026-01-17 02:14:56 +01:00
parent 1910b6d296
commit bb8d5475b8

View File

@@ -67,8 +67,11 @@
let html = wrapper.innerHTML
.replace(/<br\s*\/?>/gi, '<br>')
.replace(/(<br>)+$/g, '')
.trim();
const brCount = (html.match(/<br>/g) || []).length;
if (brCount <= 1) {
html = html.replace(/(<br>)+$/g, '').trim();
}
if (!html) {
const text = String(fallbackText || wrapper.textContent || '').trim();
if (text) html = escapeHtml(text);
@@ -103,6 +106,11 @@
if (!component) return;
const content = String(html || '');
try {
const isText = (component.is && component.is('text'))
|| (component.get && component.get('type') === 'text');
if (isText && component.components) {
component.components(content);
}
if (component.set) component.set('content', content);
} catch {}
if (component.view && component.view.el) {