From 7a5e5adb565f076579fba422a723bd50e5b40775 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 30 Jun 2015 10:12:42 +0200 Subject: [FIX] website_mail: special case for css splitting The css of a mail is inlined as best as possible for the mail sending. Previously, if there was a selector like .ch[onclick="ga(this,event)"] the simple splitting would split in the middle and get one erroneous selector (which then would trigger an error). With his commit, rules containing " or ' are ignored. opw-643548 note: forward port of 6316bce --- addons/web_editor/static/src/js/transcoder.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 8dbc0ff0104..716c6f6250d 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -38,7 +38,9 @@ var getMatchedCSSRules = function (a) { selectorText.indexOf(":after") === -1 && selectorText.indexOf(":active") === -1 && selectorText.indexOf(":link") === -1 && - selectorText.indexOf("::") === -1) { + selectorText.indexOf("::") === -1 && + selectorText.indexOf("\"") === -1 && + selectorText.indexOf("'") === -1) { var st = selectorText.split(/\s*,\s*/); for (var k=0; k