Closed viernullvier closed 5 years ago
Wow! That's a good catch. Would you mind attacking point a) so we can "fail forward"?
I've just had a look at the code. As far as I can see, there was no specific reason to rely on self.html
so I've refactored transform()
to just use its own html
argument (and fall back to self.html
in case it's not given).
For the record, @shanon-equityzen and I are discussing the release process here: https://github.com/peterbe/premailer/pull/218#issuecomment-471543169
The README contains a nice section on speeding up premailer by reusing premailer instances. This, however, throws an exception on subsequent iterations because the instance's internal
html
attribute was already set on the first iteration.Possible solutions: a) Refactor code to allow for multiple runs b) Remove problematic section from documentation