diff --git a/config/current.ver b/config/current.ver index 4e16b4e..b3aa6b7 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.1.44 \ No newline at end of file +1.1.45 \ 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 73f2acb..6196f94 100644 --- a/public/assets/js/bridge/rte-editor.js +++ b/public/assets/js/bridge/rte-editor.js @@ -890,6 +890,10 @@ if (!model || this.restoring.has(model)) return; const last = this.lastContent.get(model); if (!last || !model.get) return; + const viewEl = model.view && model.view.el; + if (viewEl && (viewEl.isContentEditable || viewEl.getAttribute('contenteditable') === 'true')) return; + const viewHtml = String(viewEl && viewEl.innerHTML || '').trim(); + if (viewHtml) return; const current = String(model.get('content') || '').trim(); if (!current || current === '
' || current === '

' || current === '


') { this.restoring.add(model); diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 86c83de..3272cca 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -415,6 +415,8 @@ if (el.isContentEditable || el.getAttribute('contenteditable') === 'true') return; const modelHtml = String(target.get ? target.get('content') || '' : '').trim(); if (!modelHtml) return; + const viewHtml = String(el.innerHTML || '').trim(); + if (viewHtml) return; const apply = () => { try { const current = String(el.innerHTML || '').trim();