From 2b4fb7e195f1baa7164ad6e7e9ae039f9ff0b044 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 28 Jan 2016 10:56:01 +0100 Subject: [FIX] web_editor: remove style attribute if empty --- addons/web_editor/static/src/js/transcoder.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/js/transcoder.js') diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 20779bf19aa..4b613ba636c 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -173,7 +173,11 @@ var class_to_style = function ($editable) { style = k+":"+v+";"+style; } }); - $target.attr("style", style); + if (_.isEmpty(style)) { + $target.removeAttr("style"); + } else { + $target.attr("style", style); + } }); }; // convert style into inline class from mail -- cgit v1.2.3