From 8668618aa0b9e47fd3b672ad4179f4037b5a2fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Fri, 20 Oct 2023 09:35:21 +0200 Subject: [PATCH] Prevent TinyMCE to remove styles when content is pasted from a template fixes #15636 --- js/fileupload.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/fileupload.js b/js/fileupload.js index 266ec30aa6a..baf410bd652 100644 --- a/js/fileupload.js +++ b/js/fileupload.js @@ -349,7 +349,8 @@ const setRichTextEditorContent = function(editor_id, content) { editor.setContent(''); // use paste command to force images registering editor.execCommand('mceInsertClipboardContent', false, { - html: content + html: content, + internal: true, // disable some filterings operations that would remove styles (maybe a bug) }); // force trigger of event handlers that will save editor contents // and remove "required" state