summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets/ace.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-02-22 10:39:15 +0100
committerChristophe Simonis <chs@odoo.com>2018-02-22 10:39:15 +0100
commit9a84ba55330204c49e9c72d9e53660dfd11556ae (patch)
tree10c207733941a30d5ab86285ecb1c8b130c14200 /addons/web_editor/static/src/js/widgets/ace.js
parent898cd0a5c1a9696f051477c1318a76c31eb40a16 (diff)
parente750bb6e1149cb05e13424d66d4ff12198b4cffe (diff)
[MERGE] forward port branch saas-11.1 up to e750bb6e114
Diffstat (limited to 'addons/web_editor/static/src/js/widgets/ace.js')
-rw-r--r--addons/web_editor/static/src/js/widgets/ace.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/widgets/ace.js b/addons/web_editor/static/src/js/widgets/ace.js
index 1b8996beaa5..1057958f983 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 (/<script(?: [^>]*)?>[^<][\s\S]*<\/script>/i.test(xml)) {
+ return xml;
+ }
return window.vkbeautify.xml(xml, 4);
}
/**