Today I released a new major version of premailer where the only difference is that one of the default options have changed from True to False.
The git commit for this change might look big but the only difference is that now, by default, the HTML class attribute is kept in the output HTML.

When premailer started, the land of HTML emails was very different. Basically, you used to not use CSS media queries, so, no reason to keep the class attribute. Now, these days, all pretty HTML emails need media queries and for that to work you need to have the class attribute kept in the HTML.

So fear not the major version upgrade! If you used to use premailer like this:


from premailer import Premailer

transformer = Premailer(html)
output_html = transformer.transform()

You now need to change it to:


from premailer import Premailer

transformer = Premailer(html, remove_classes=True)
output_html = transformer.transform()

As always, you can play with it on premailer.io.

Comments

Your email will never ever be published.

Previous:
CSS Bloat Comparison June 3, 2016 Web development, JavaScript
Next:
json-schema-reducer August 2, 2016 Python
Related by category:
How I run standalone Python in 2025 January 14, 2025 Python
get in JavaScript is the same as property in Python February 13, 2025 Python
How to resolve a git conflict in poetry.lock February 7, 2020 Python
Best practice with retries with requests April 19, 2017 Python
Related by keyword:
get in JavaScript is the same as property in Python February 13, 2025 Python, JavaScript
Premailer.io July 8, 2015 Python, Web development, AngularJS, JavaScript
premailer.py - Transform CSS into line style attributes with lxml.html July 11, 2009 Python
premailer now excludes pseudo selectors by default May 27, 2013 Python, Web development