Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LIBXML_NOBLANKS to make the output same on Linux and Windows
We are using this library through Symfony to inline CSS in e-mails. We are also using snapshot testing for rendered e-mails templates and I discovered that the output of this library differs between Windows (dev machine) and Linux (CI). I tried running the test suite on Windows and the test CssToInlineStylesTest::testSpecificity() fails because of whitespace difference: on Windows there is an extra \n before the closing </a> in the output. I tried loading and saving a a super-simplified HTML <a>\n<img>\n</a> through the DOMDocument without this library but with the same settings and a similar thing happen (newline before </a> is present on Windows but missing on Linux). When the option LIBXML_NOBLANKS is added to loadHTML() the output no longer differs between the Windows and Linux. To be honest, I'm not sure if this is a proper fix. It should be rather considered a bug report with a workaround.
- Loading branch information