This commit is contained in:
2026-01-26 00:01:27 +01:00
parent 4d45190d2d
commit d03c4a5d10

View File

@@ -15,7 +15,24 @@
static serializeHtml(editor) { static serializeHtml(editor) {
if (!editor || typeof editor.getHtml !== 'function') return ''; 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 { try {
const wrapper = editor.getWrapper && editor.getWrapper(); const wrapper = editor.getWrapper && editor.getWrapper();
if (wrapper && wrapper.find) { if (wrapper && wrapper.find) {