diff --git a/config/current.ver b/config/current.ver index 5165303..d7f1518 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.1.11 \ No newline at end of file +1.1.12 \ No newline at end of file diff --git a/public/assets/js/bridge/rte-editor.js b/public/assets/js/bridge/rte-editor.js index b0830d4..790e4c1 100644 --- a/public/assets/js/bridge/rte-editor.js +++ b/public/assets/js/bridge/rte-editor.js @@ -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 { diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 94e3820..7fb7439 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -341,6 +341,7 @@ return model; }; const lastContent = new Map(); + const syncing = new WeakSet(); const normalizeHtml = (value) => { return String(value || '') .replace(//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) => {