v0.64.1/extended windows/amd64
When I use hugo --minify in my branch/repo:
New lines not minified:

Space inside tag striped:


yes me too, but this just happen on <a> tag only.
I want to clarify that "newlines are not minified" is incorrect. The minifier removes superfluous whitespace, but sometimes whitespace in HTML has meaning and cannot be removed. In that case either a space or a newline are required, and both have the same effect. The minifier will let the remaining _significant_ whitespace be a newline when any of the original whitespace characters contained a newline. This newline _cannot_ be removed without changing the display of HTML.
You second issue that whitespaces get remove in tags, this is because you use the CSS white-space property or you change display to inline. This changes the semantical meaning of HTML and may influence layouts that depend on whitespace for formatting. It is not recommended to let your HTML layout depend on whitespace!
@tdewolff thanks for the input and your work on this, much appreciated. I have not looked into this particular issue, but we just merged way to configure and turn off a given minified, so that should solve most of these issues.
@tdewolff Just a minify note. It appears that the first nested <source> block inside a <picture> element, preserves the newlines between the parent picture and first source element. I don't see why they should be preserved.


Thanks for that! I've fixed it in https://github.com/tdewolff/minify/commit/8a5c9ca87945e475609daffac2634532fe4518cb. Seems that both audio and picture could remove their initial space. Make sure you have KeepWhitespace = false!
Thanks @tdewolff . Will wait for @bep to let us know what version this is updated in.
@tdewolff Any chance you can cut a new release so master branch changes can be leveraged?
@bep any chance we can get an updated build with latest tdewolff/minify version?
Will push one out soon, I'm very busy with work these weeks unfortunately :-( sorry about that
@virgofx I had to revert to an older version of that library some time ago as it broke many sites in the wild. So we're currently a little behind.
I've pushed out 2.7.4
I too have had issues with spaces being remove, and the other thing I noticed with hugo --minify is that these select list options are not minified which I found interesting.

Thanks @bugsysailor, fixed your issue in https://github.com/tdewolff/minify/commit/7d9c4604da3a2c21bc3b21efa553ba1b19f5254e
Please remember that Hugo prevents removal of end tags. The default settings of the minifier will remove all superfluous </option> end tags. Let me know if you hit any other tips!
Is there any way to get rid of the new lines with the current config settings? I've set all the "Keep…" options to false, although I still get new lines. My HTML/CSS is set up in such a way where it doesn't rely on whitespace so they aren't needed
Some whitespace is significant in HTML, that whitespace character may be a space or a newline (both are 1 byte long). Eventhough your file contains newlines it may not be possible to further minify its contents.
Most helpful comment
Thanks @bugsysailor, fixed your issue in https://github.com/tdewolff/minify/commit/7d9c4604da3a2c21bc3b21efa553ba1b19f5254e
Please remember that Hugo prevents removal of end tags. The default settings of the minifier will remove all superfluous
</option>end tags. Let me know if you hit any other tips!