From 0987ee5b5efc00a1315412e0e38eb4b4f0d8b059 Mon Sep 17 00:00:00 2001 From: vishal padhiyar Date: Thu, 24 Aug 2023 11:52:44 +0000 Subject: [PATCH] [FIX] web_editor: sanitize html pasted in codeview Before this commit: When we paste html using selectAll and we click code view button then the newly added template will be visible and immediately got removed by old template. This problem is because of pasted html is not sanitized. After this commit: Now when we paste html using selectAll then we actually see new html template in result. task-3473633 closes odoo/odoo#139384 X-original-commit: 6d6e1527ccdf5e616330905bc4b7e4fdd80c6192 Signed-off-by: David Monjoie (dmo) --- addons/mass_mailing/static/src/js/mass_mailing_html_field.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js index f66a94fddf1..c405ac873be 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js @@ -250,6 +250,8 @@ export class MassMailingHtmlField extends HtmlField { if ($codeview.hasClass('d-none')) { this.wysiwyg.setValue($codeview.val()); + this.wysiwyg.odooEditor.sanitize(); + this.wysiwyg.odooEditor.historyStep(true); } else { $codeview.val(this.wysiwyg.getValue()); }