Closed positiveviking closed 7 years ago
In emails.transformer.HTMLParser default value of output_method parameter can not be changed from inherited class constructors.
emails.transformer.HTMLParser
When we use default output_method='xml' there are following issue with empty tags: Input data: <span></span>123
<span></span>123
Expect after loading: <html><head></head><body><span></span>123</body></html>
<html><head></head><body><span></span>123</body></html>
Actual after loading: <html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/></head><body><span/>123</body></html>
<html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/></head><body><span/>123</body></html>
And browsers render this like <html><head></head><body><span>123</span></body></html>
<html><head></head><body><span>123</span></body></html>
Code for proof:
import emails.loader emails.loader.from_html('<html><head></head><body><span></span>123</body></html>').html
PS output_method='html' fixes this issue.
In
emails.transformer.HTMLParser
default value of output_method parameter can not be changed from inherited class constructors.When we use default output_method='xml' there are following issue with empty tags: Input data:
<span></span>123
Expect after loading:
<html><head></head><body><span></span>123</body></html>
Actual after loading:
<html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/></head><body><span/>123</body></html>
And browsers render this like
<html><head></head><body><span>123</span></body></html>
Code for proof: