Skip to content

Commit

Permalink
Prevent TinyMCE to remove styles when content is pasted from a template
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne authored and trasher committed Oct 25, 2023
1 parent 982734a commit 8668618
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/fileupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8668618

Please sign in to comment.