From ea07b7dc2bf455a8fe0dec577ef9794a9a53fee9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 2 Sep 2015 17:43:19 +0200 Subject: [PATCH] [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. --- addons/website/static/src/js/website.editor.js | 6 ++++-- 1 file 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 = $('
').text(this.nodeValue).html(); } }); var markup = escaped_el.prop('outerHTML');