From 365e298fb1907085d4071285c2be5dbcd5c59a0e Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 18 Jan 2016 16:50:18 +0100 Subject: [PATCH] [FIX] web_editor: inliner don't apply color when background-color --- addons/web_editor/static/src/js/transcoder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 24465804bc8..5e699367dc2 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -169,7 +169,7 @@ var class_to_style = function ($editable) { var css = getMatchedCSSRules(this); var style = $target.attr("style") || ""; _.each(css, function (v,k) { - if (style.indexOf(k) === -1) { + if (!(new RegExp('(^|;)\s*' + k).test(style))) { style = k+":"+v+";"+style; } }); @@ -187,7 +187,7 @@ var style_to_class = function ($editable) { var css = getMatchedCSSRules(this); var style = ""; _.each(css, function (v,k) { - if (style.indexOf(k) === -1) { + if (!(new RegExp('(^|;)\s*' + k).test(style))) { style = k+":"+v+";"+style; } });