sadsad
This commit is contained in:
@@ -470,10 +470,23 @@
|
|||||||
: '';
|
: '';
|
||||||
const cssPayload = (fontCss ? fontCss + '\n' : '') + editor.getCss();
|
const cssPayload = (fontCss ? fontCss + '\n' : '') + editor.getCss();
|
||||||
const serializeHtml = () => {
|
const serializeHtml = () => {
|
||||||
|
const rawHtml = editor.getHtml() || '';
|
||||||
if (B && B.BridgeRTE && typeof B.BridgeRTE.serializeHtml === 'function') {
|
if (B && B.BridgeRTE && typeof B.BridgeRTE.serializeHtml === 'function') {
|
||||||
return B.BridgeRTE.serializeHtml(editor);
|
try {
|
||||||
|
let patched = B.BridgeRTE.serializeHtml(editor) || '';
|
||||||
|
if (patched) {
|
||||||
|
const bodyMatch = patched.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
|
||||||
|
if (bodyMatch) patched = bodyMatch[1];
|
||||||
|
}
|
||||||
|
if (!patched || (rawHtml && patched.length < rawHtml.length * 0.6)) {
|
||||||
|
return rawHtml;
|
||||||
|
}
|
||||||
|
return patched;
|
||||||
|
} catch {
|
||||||
|
return rawHtml;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return editor.getHtml();
|
return rawHtml;
|
||||||
};
|
};
|
||||||
const htmlContent = serializeHtml() + '<style>' + cssPayload + '</style>';
|
const htmlContent = serializeHtml() + '<style>' + cssPayload + '</style>';
|
||||||
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
|
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
|
||||||
|
|||||||
Reference in New Issue
Block a user