diff --git a/public/assets/js/bridge/rte-editor.js b/public/assets/js/bridge/rte-editor.js index c9aea41..c9f02c3 100644 --- a/public/assets/js/bridge/rte-editor.js +++ b/public/assets/js/bridge/rte-editor.js @@ -15,7 +15,24 @@ static serializeHtml(editor) { if (!editor || typeof editor.getHtml !== 'function') return ''; - let html = editor.getHtml(); + let html = editor.getHtml() || ''; + if (!html) { + try { + const wrapper = editor.getWrapper && editor.getWrapper(); + if (wrapper && typeof wrapper.toHTML === 'function') { + html = wrapper.toHTML(); + } + } catch {} + } + if (!html) { + try { + const wrapper = editor.getWrapper && editor.getWrapper(); + const el = wrapper && wrapper.view && wrapper.view.el ? wrapper.view.el : null; + if (el && el.innerHTML) { + html = String(el.innerHTML || ''); + } + } catch {} + } try { const wrapper = editor.getWrapper && editor.getWrapper(); if (wrapper && wrapper.find) {