diff --git a/public/assets/js/bridge/rte-editor.js b/public/assets/js/bridge/rte-editor.js index f1ea16e..a737a24 100644 --- a/public/assets/js/bridge/rte-editor.js +++ b/public/assets/js/bridge/rte-editor.js @@ -290,11 +290,16 @@ saveBtn.style.color = '#ffffff'; saveBtn.style.cursor = 'pointer'; saveBtn.addEventListener('click', () => { - const html = content.innerHTML; + let html = String(content.innerHTML || '').trim(); const isTextLike = component && component.is && (component.is('text') || component.is('button') || component.is('link')); - const hasTags = /<[^>]+>/.test(html); + if (!html) { + const fallbackText = String(content.textContent || '').trim(); + if (fallbackText) { + html = fallbackText.replace(//g, '>'); + } + } try { - if (component.components) { + if (!isTextLike && component.components) { component.components(html); } if (component.set) {