Closed claudep closed 1 year ago
Thanks. That's definitely better idea than mine (of skipping HTML tests). I also like that you're using DOM to create elements, that's probably the most efficient way of doing it.
Thanks!
Thanks for the merge.
While I was on this format, I explored a bit about adding html import support, also without external dependency: #555
I noticed that this change breaks the CI build in django-import-export. This is for cases when we are escaping harmful characters such as script tags.
If there is already an escaped character in content, then the use of ElementTree will double escape, which will not format correctly. This test will reproduce the issue:
def test_html_export_with_special_chars(self):
self.founders = tablib.Dataset(headers=self.headers, title='Founders')
self.founders.append(('J & J', 'A', 90))
self.assertIn("J & J", self.founders.html)
This test fails because the '&' string is exported as '&' So if someone has 'J & J' in their content (rendered with an escape), they will now get 'J & J'.
@matthewhegarty Please create a new issue for this problem where we can discuss that double-escaping issue.
Codecov Report
95.45% <100.00%> (-0.06%)
100.00% <100.00%> (ø)
98.72% <100.00%> (-0.03%)
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more