Hello there. First off, thanks to all of you who contribute to this project. I really enjoy using hugo, and use it to build my personal site.
So I just upgraded to version 0.47.1 and wanted to test out the hugo --minify command. In my testing, I noticed that the command stripped out my </p> tags (see my examples below). Was just wondering if that was intended behavior?
Output of hugo env
Hugo Static Site Generator v0.47.1 windows/386 BuildDate: 2018-08-20T08:17:27Z
GOOS="windows"
GOARCH="386"
GOVERSION="go1.10.3"
I doubt that was the intended behavior. We have to see your site’s code to see why that is happening. Please check out Requesting Help and share some code.
Issue closed and the fix will be available in the next Hugo release.
Also if you see anything else stripped by the minifier please let us know.
So far there have been a couple of similar issues, because the default configuration of the minifier from upstream is a bit aggressive and additional flags need to be added manually.
So removing those closing tags is a smart optimization.
I’d bet that your site still behaves functionally well without those closing tags.
@bep I’d suggest reverting this commit, if re-adding the closing tags is just cosmetic. This is a minify feature that does some good cruft cutting (it not removing only optional closing p tags, it’s much more).
What is the browser test coverage for the “stripped tags” option? And I don’t mean your “Chrome seem to be fine with it” kind of tests. A complete test suite.
I have been minifying my site with the same library for more than 6 months (i.e. even before it got integrated with Hugo via the --minify switch) and I didn’t use this “don’t remove end tags” option – I’ve never faced any issue.
To be honest, the one on the right looks correct. Can you share the site source that has that white space between elements?
Here the white space on the left (before minify) most likely has nothing to do with absence/presence of end tags. But I’d like to inspect that element and see what’s adding that white space.
If you want to add such space between elements, I think the CSS padding/margin properties should be used.
The li elements have closing tags when I inspect your page with the Dev Tools in Firefox.
You need to have padding or margin set between these elements or if it is a phrase a space after the first li should do, so that a search engine could read that phrase properly.