This commit is contained in:
2026-01-27 00:52:50 +01:00
parent b16bfcc905
commit 348149722e
3 changed files with 15 additions and 2 deletions

View File

@@ -1 +1 @@
1.1.11
1.1.12

View File

@@ -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 {

View File

@@ -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) => {