diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/commands.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/commands.js index a40989597d1..a3cc1137074 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/commands.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/commands/commands.js @@ -165,10 +165,10 @@ export const editorCommands = { const containerFirstChild = document.createElement('fake-element-fc'); const containerLastChild = document.createElement('fake-element-lc'); - if (content instanceof editor.document.defaultView.Node) { - container.replaceChildren(content); - } else { + if (typeof content === 'string') { container.textContent = content; + } else { + container.replaceChildren(content); } // In case the html inserted starts with a list and will be inserted within