[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.
This commit is contained in:
Nicolas Lempereur 2015-09-02 17:43:19 +02:00
parent 56a6483477
commit ea07b7dc2b
1 changed files with 4 additions and 2 deletions

View File

@ -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');