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