From 32a7c01a5ca079e2e933804fa038cc55539f377d Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 23 Jan 2023 11:40:45 +0000 Subject: [PATCH] [FIX] web_editor: remove contenteditable attribute in converted email When converting html for emails, contenteditable attributes should be removed. X-original-commit: 9b4cff9f6ab8e1738f3fc486875f9e4ab16cea9d Part-of: odoo/odoo#111778 --- addons/web_editor/static/src/js/backend/convert_inline.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index bb7955fec2b..0889c929733 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -609,6 +609,9 @@ async function toInline($editable, cssRules, $iframe) { enforceImagesResponsivity(editable); await flattenBackgroundImages(editable); + // Remove contenteditable attributes + [editable, ...editable.querySelectorAll('[contenteditable]')].forEach(node => node.removeAttribute('contenteditable')); + // Hide replaced cells on Outlook for (const toHide of editable.querySelectorAll('.mso-hide')) { const style = toHide.getAttribute('style') || '';