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