diff --git a/addons/web_editor/static/src/js/widgets/ace.js b/addons/web_editor/static/src/js/widgets/ace.js index 0a89d0d8ce7..64502b41c31 100644 --- a/addons/web_editor/static/src/js/widgets/ace.js +++ b/addons/web_editor/static/src/js/widgets/ace.js @@ -58,6 +58,10 @@ function checkXML(xml) { * @returns {string} formatted xml */ function formatXML(xml) { + // do nothing if an inline script is present to avoid breaking it + if (/]*)?>[^<][\s\S]*<\/script>/i.test(xml)) { + return xml; + } return window.vkbeautify.xml(xml, 4); } /**