danschultzer / premailex

Preflight for your HTML emails - inline styling and plain text.
MIT License
172 stars 20 forks source link

Add spaces between inline CSS : and ; #73

Closed philipbrown closed 2 years ago

philipbrown commented 2 years ago

Gmail strips out inline styles if there isn't spaces [source].

This PR adds spaces when converting using the to_string method.

danschultzer commented 2 years ago

Thanks, I've updated the PR to test this properly. Also per your link, this is troubling:

In addition to this behavior, I noticed that Gmail tends to strip out the inline style if you declare a font-family inside a nested <table> or a <td>, I'm still not sure on what is the general rule of its preprocessor, I checked on Google but I can't find any official documentation about html mail composition for Gmail.

I will review the rules before merging this to make sure the inline styles are accepted by gmail.