Commit Graph

7 Commits (d42a4ff4b0f4cc5f12e177cee740e23e3d5fa5f8)

Author SHA1 Message Date
Simone Orsi 67e4fc673a mail_inline_css: fix transform hook
The mail module offers a better hook to manipulate html: `render_post_process`.
By using this, we make sure the transform is applied properly
before html tags sanitizing happens,
which can alter - if not screw - the final result.

Finally, it simplifies code :)
2020-09-08 08:50:52 +02:00
Guewen Baconnier 9309136848 Fix issue on empty template with premailer
If premailer receives an empty value, such as an empty string,
on parsing, it returns None and fails when trying to call
'etree.fromstring()' on this None result.

We should avoid to call premailer on an empty string, as the result
will anyway not change.

We may have an empty template for instance when a template could not
compile due to a mistake.
2020-08-27 15:17:51 +02:00
Simone Orsi 2e0487593a [MIG] mail_inline_css: Migration to 13.0 2020-01-17 15:10:43 +01:00
Simone Orsi 7216bc3d40 [REF] mail_inline_css: apply pre-commit 2020-01-17 15:10:43 +01:00
Simone Orsi 8552c797ca mail_inline_css: unify premailer transform apply 2020-01-17 15:10:43 +01:00
mpanarin 53127dad71 [IMP] mail_inline_css: allow passing options to premailer 2020-01-17 15:10:43 +01:00
Timon Tschanz 017000413b [IMP] mail_inline_css: Improve and add test cov 2020-01-17 15:10:43 +01:00