summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2015-09-02 17:43:19 +0200
committerNicolas Lempereur <nle@odoo.com>2015-09-02 18:36:19 +0200
commitea07b7dc2bf455a8fe0dec577ef9794a9a53fee9 (patch)
tree996be00632e66ceea28e0af572d348b80dfd1260 /addons
parent56a64834770a75699d7f9d5409601d08cfe49174 (diff)
[FIX] website: don't escape if embedded html field
We should escape arch ir.ui.view arch content, but we should not escape embedded html field content.
Diffstat (limited to 'addons')
-rw-r--r--addons/website/static/src/js/website.editor.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 43df01d3514..212014feb2a 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -425,9 +425,11 @@
saveElement: function ($el) {
// escape text nodes for xml saving
var escaped_el = $el.clone();
- escaped_el.find('*').addBack().not('script,style').contents().each(function(){
+ var to_escape = escaped_el.find('*').addBack();
+ to_escape = to_escape.not(to_escape.filter('script,style,[data-oe-model][data-oe-model!="ir.ui.view"]').find('*').addBack());
+ to_escape.contents().each(function(){
if(this.nodeType == 3) {
- this.nodeValue = _.escape(this.nodeValue);
+ this.nodeValue = $('<div />').text(this.nodeValue).html();
}
});
var markup = escaped_el.prop('outerHTML');