asdasd
This commit is contained in:
@@ -173,12 +173,12 @@
|
||||
const isText = (component.is && component.is('text'))
|
||||
|| (component.get && component.get('type') === 'text');
|
||||
try {
|
||||
if (component.set) component.set('content', content);
|
||||
if (isText && component.components) {
|
||||
try {
|
||||
component.components(content);
|
||||
} catch {}
|
||||
}
|
||||
if (component.set) component.set('content', content);
|
||||
} catch {}
|
||||
if (isText && component.view && component.view.el) {
|
||||
try {
|
||||
|
||||
@@ -341,6 +341,7 @@
|
||||
return model;
|
||||
};
|
||||
const lastContent = new Map();
|
||||
const syncing = new WeakSet();
|
||||
const normalizeHtml = (value) => {
|
||||
return String(value || '')
|
||||
.replace(/<br\s*\/?>/gi, '')
|
||||
@@ -376,6 +377,18 @@
|
||||
if (!isTextLike(target)) return;
|
||||
const snap = snapshotContent(target);
|
||||
if (!snap.normalized) return;
|
||||
if (!syncing.has(target)) {
|
||||
const currentContent = target.get ? String(target.get('content') || '').trim() : '';
|
||||
if (currentContent !== snap.html) {
|
||||
try {
|
||||
syncing.add(target);
|
||||
if (target.set) target.set('content', snap.html);
|
||||
if (target.components) target.components(snap.html);
|
||||
} catch {} finally {
|
||||
syncing.delete(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
storeSnapshot(target, snap);
|
||||
};
|
||||
const restoreIfEmpty = (model) => {
|
||||
|
||||
Reference in New Issue
Block a user