pytest-html
pytest-html copied to clipboard
Fix report template
Motivation
My colleague had issues with displaying generated reports:
The report was correctly displayed on:
- my Linux/Firefox machine.
- his Windows/Edge
The report had no content or even showed blank page on:
- on his computer windows/firefox
- on his computer windows/chrome
When I checked the generated report file I noticed that:
- some tags were not properly closed
- some special characters are not escaped properly
Issues
Examples
-
https://github.com/pytest-dev/pytest-html/blob/4b714aa558b1f7b8af1035033e4e94601ef75c4b/src/pytest_html/resources/index.jinja2#L32
-
https://github.com/pytest-dev/pytest-html/blob/4b714aa558b1f7b8af1035033e4e94601ef75c4b/src/pytest_html/resources/index.jinja2#L51
Misc
This PR also adds djlint to pre-commit hook.
Changes
Fixed
- Fixed tags in report template.
Added
- Added pre-commit hook to validate report template.
Nice!
Thank you for this!
@BeyondEvil Do we need something more to merge?