summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets/ace.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-02-21 20:19:26 +0100
committerChristophe Simonis <chs@odoo.com>2018-02-21 20:19:26 +0100
commitae6a65753e57fd2e31f2fb9a0675fdc7266ad38c (patch)
treea16174284684978612798d19fab2e05ac492aef1 /addons/web_editor/static/src/js/widgets/ace.js
parent90e8da9b4f792919c14c7de1d8596bf2056f58b2 (diff)
parentdbb713c2f836892de516e8d5e313a5dab8919a56 (diff)
[MERGE] forward port branch 11.0 up to dbb713c2f83
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 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 (/<script(?: [^>]*)?>[^<][\s\S]*<\/script>/i.test(xml)) {
+ return xml;
+ }
return window.vkbeautify.xml(xml, 4);
}
/**