philhawksworth / netlify-plugin-minify-html

26 stars 8 forks source link

Ensure text nodes don't have space removed #19

Closed daviddarnes closed 3 years ago

daviddarnes commented 3 years ago

I'm not sure what's happening in the the plugin but the collapseWhitespace option is being set to true even when it's not set at all and the default being false, as seen here in the docs for html-minifier.

I tried a couple of ways to prevent it returning true without luck, next best thing was to explicitly apply it and allow plugin users to overwrite it with the minifierOptions key in their netlify.toml file.

I'm hoping this will fix #13 #15 and #18. This issue has come up enough that I think it justifies being the default.

philhawksworth commented 3 years ago

Strange. But this is a crafty and helpful fix, @daviddarnes! Big thanks!