Middleware CollapseWhitespaces trim whitespaces and new lines inside HTML elements it should not touch and thus it is breaking functionality, even perhaps entire sites.
Motivation and context
We have inline JS, CSS and use pre and textarea. Inline JS for example is in our page layout so there is no option to skip a route - it would mean skipping everything. As such there needs to be a way to skip HTML elements whose content you shouldn't be modifying.
This is only a continuation of the fork by SergeyPodgornyy (https://github.com/renatomarinho/laravel-page-speed/pull/81) which does not address all the HTML elements that need skipping. This adds some missing ones and modifies the code so that other HTML elements can be added as well if you need more skipped.
How has this been tested?
So far testing in our own production site. I know my PR won't be accepted without tests, which I am unsure how to do.
Screenshots
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
Middleware CollapseWhitespaces trim whitespaces and new lines inside HTML elements it should not touch and thus it is breaking functionality, even perhaps entire sites.
Motivation and context
We have inline JS, CSS and use pre and textarea. Inline JS for example is in our page layout so there is no option to skip a route - it would mean skipping everything. As such there needs to be a way to skip HTML elements whose content you shouldn't be modifying. This is only a continuation of the fork by SergeyPodgornyy (https://github.com/renatomarinho/laravel-page-speed/pull/81) which does not address all the HTML elements that need skipping. This adds some missing ones and modifies the code so that other HTML elements can be added as well if you need more skipped.
How has this been tested?
So far testing in our own production site. I know my PR won't be accepted without tests, which I am unsure how to do.
Screenshots
Types of changes
Checklist: