From 044f1b2db0c71b749b2f3439e178d3f0c4636dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Geelen=20=28sge=29?= Date: Wed, 15 Mar 2023 15:53:00 +0000 Subject: [PATCH] [FIX] web_editor: ensure t-out are inline Force the sanitization after a dynamic placeholder is inserted. By default the `` tags are styled as block element, except if they have the `data-oe-t-inline` attribute set. The sanitization process ensure the `` tags have this attribute. With this change the new `` tags added as dynamic placeholder visual are properly styled as inline elements. task-3222474 X-original-commit: 08558502ea0726a97c80aae7d1e2084b2bf3952a Part-of: odoo/odoo#124020 --- addons/web_editor/static/src/js/backend/html_field.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index 9632128e211..01d5518e726 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -373,6 +373,8 @@ export class HtmlField extends Component { const t = document.createElement('T'); t.setAttribute('t-out', dynamicPlaceholder); this.wysiwyg.odooEditor.execCommand('insert', t); + // Ensure the dynamic placeholder element is sanitized. + this.wysiwyg.odooEditor.sanitize(t); } } onDynamicPlaceholderClose() {