diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2015-06-30 10:12:42 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2015-09-08 13:29:23 +0200 |
| commit | 7a5e5adb565f076579fba422a723bd50e5b40775 (patch) | |
| tree | 1d48a783b57978f28050e9b67f5c9fb21ab9024d /addons/web_editor/static/src/js/transcoder.js | |
| parent | 222c7308fe3b93a2cf1014f6cb6defd41f036ac1 (diff) | |
[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
Diffstat (limited to 'addons/web_editor/static/src/js/transcoder.js')
| -rw-r--r-- | addons/web_editor/static/src/js/transcoder.js | 6 |
1 files changed, 4 insertions, 2 deletions
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<st.length; k++) { rulesCache.push({ 'selector': st[k], 'style': rules[r].style }); @@ -182,4 +184,4 @@ return { 'style_to_class': style_to_class, }; -});
\ No newline at end of file +}); |
