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() {