diff --git a/config/current.ver b/config/current.ver index 7b330ae..7664e79 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.56 \ No newline at end of file +1.2.57 \ No newline at end of file diff --git a/public/assets/js/bridge/blocks-api.js b/public/assets/js/bridge/blocks-api.js index 66ec12f..d70c53d 100644 --- a/public/assets/js/bridge/blocks-api.js +++ b/public/assets/js/bridge/blocks-api.js @@ -611,7 +611,16 @@ : ''; const cssPayload = (fontCss ? fontCss + '\n' : '') + editor.getCss(); const serializeHtml = () => { - const rawHtml = editor.getHtml() || ''; + let rawHtml = editor.getHtml() || ''; + try { + const doc = editor.Canvas && editor.Canvas.getDocument ? editor.Canvas.getDocument() : null; + const body = doc && doc.body; + const liveHtml = body ? String(body.innerHTML || '') : ''; + if (liveHtml && liveHtml.length >= rawHtml.length * 0.8) { + // Remove contenteditable artifacts from live DOM HTML + rawHtml = liveHtml.replace(/\scontenteditable="[^"]*"/gi, ''); + } + } catch {} if (B && B.BridgeRTE && typeof B.BridgeRTE.serializeHtml === 'function') { try { let patched = B.BridgeRTE.serializeHtml(editor) || '';