sadasd
This commit is contained in:
@@ -67,8 +67,11 @@
|
|||||||
|
|
||||||
let html = wrapper.innerHTML
|
let html = wrapper.innerHTML
|
||||||
.replace(/<br\s*\/?>/gi, '<br>')
|
.replace(/<br\s*\/?>/gi, '<br>')
|
||||||
.replace(/(<br>)+$/g, '')
|
|
||||||
.trim();
|
.trim();
|
||||||
|
const brCount = (html.match(/<br>/g) || []).length;
|
||||||
|
if (brCount <= 1) {
|
||||||
|
html = html.replace(/(<br>)+$/g, '').trim();
|
||||||
|
}
|
||||||
if (!html) {
|
if (!html) {
|
||||||
const text = String(fallbackText || wrapper.textContent || '').trim();
|
const text = String(fallbackText || wrapper.textContent || '').trim();
|
||||||
if (text) html = escapeHtml(text);
|
if (text) html = escapeHtml(text);
|
||||||
@@ -103,6 +106,11 @@
|
|||||||
if (!component) return;
|
if (!component) return;
|
||||||
const content = String(html || '');
|
const content = String(html || '');
|
||||||
try {
|
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);
|
if (component.set) component.set('content', content);
|
||||||
} catch {}
|
} catch {}
|
||||||
if (component.view && component.view.el) {
|
if (component.view && component.view.el) {
|
||||||
|
|||||||
Reference in New Issue
Block a user