| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Windows checkouts feed CRLF into the CSS and XML/HTML content views, which then fail to match the expected LF-formatted fixtures. Normalize line endings before prettifying so the views are platform-independent. Fixes #8253.
|
Do I read this correctly that this is only an issue in tests? If yes, we should fix the tests. |
Sorry, something went wrong.
|
Yes — the reported failures are checkout-dependent tests, not a content-view runtime bug. Thanks for catching that. I updated the PR to keep the CSS and XML/HTML fixture directories on LF via .gitattributes, and removed both the production normalization and the CRLF behavior tests. Validation on the updated head:
|
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #8253.
What changed
CSS beautify() and the XML/HTML content view now normalize CRLF/CR to LF before formatting. On Windows, repository files are often checked out with CRLF, so the prettifiers produced output that did not match the LF fixtures.
Tests
Added explicit CRLF regression tests that do not depend on git autocrlf:
pytest test/mitmproxy/contentviews/test__view_css.py test/mitmproxy/contentviews/test__view_xml_html.py — 22 passed.
AI assistance disclosure
OpenAI Codex / Cursor Grok assisted with locating the prettify entry points, adding line-ending normalization, and drafting the regression tests. I reviewed the diff and ran the tests above.