[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
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user