New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve 6 character color codes for Lotus Notes #114
Comments
I think Notes is only looking at |
Have you had any luck finding where the conversion of |
Well, yes and no. It's somewhere inside
Though I can hardly blame them since normally I'd prefer the shorter version... it's just problematic with old and broken user agents. |
If there's no easy and obvious way to control that from outside |
For future reference: # Hacky fix for Lotus Notes. It doesn't handle three character bgcolor codes well
# see https://github.com/peterbe/premailer/issues/114
short_bgcolor_codes = re.compile(r'bgcolor="#([0-9A-F])([0-9A-F])([0-9A-F])"', re.I)
inlined_html = short_bgcolor_codes.sub(r'bgcolor="#\1\1\2\2\3\3"', inlined_html) # double digits to enlongen color code``` |
So it's only applicable for |
I wouldn't swear that's the only problematic case, but it's the only one that has bit us so far. I wouldn't be surprised if stuff like I don't love munging HTML with regexs so I try to make it as narrow as possible. |
We can put a big fat comment that explains the hack. |
I am trying out the regular expression by @elidickinson also, as I have also struck the same problem. The Litmus blog has a post about the problem with 3-value hex colours. |
The reports back is that the fix worked (I also dropped @peterbe, would you like a unit-test and hack in Premailer, or shall I try and take this up with the CSS Utils folks and try and get a flag in upstream? |
@mpj17 Yes, I think we should do it in premailer. As long as there's a healthy comment the explains the why, I think it's useful. |
Ok, I will try and work on it next Tuesday evening. |
Should be solved with e5f73b0 |
As you may be aware, the IBM/Lotus Notes email client has poor HTML support. One of its quirks is that it sometimes (only sometimes!) gets confused by "short" color codes like
#FFF
instead of#FFFFFF
. Which is unfortunate because Premailer is automatically converting to the short versions when possible. Any idea how to get it to stop? Or even where that's coming from? I'm guessing somewhere deep in cssselect...This HTML:
Looks like this in Notes 8.5:
The text was updated successfully, but these errors were encountered: