Open Toutouwai opened 9 years ago
Just saw this:
NOTE: AIOM+ removes all whitespaces between two tags. If you explicitly need a whitespace, change the whitespace into an HTML entity:
.
This doesn't seem like an adequate solution to me. A non-breaking space is not the same as a space - I want my lines to be able to break at the space character.
Would be nice if HTML minify was smart enough to work out when a literal space character is intended between tags. Looking at a couple of other HTML minify tools, the preserving of these kinds of spaces happens by default or can be enabled through an option. http://www.willpeavy.com/minifier/ http://kangax.github.io/html-minifier/ https://code.google.com/p/htmlcompressor/ Perhaps single spaces between tags could be preserved while multiple spaces are replaced by a single space?
Just had the same problem. I think tags in paragraphs should definitely retain their surrounding spaces because often you are "selecting" specific words within the paragraph and then when the HTML is minified it bunches those words together. Not desirable behaviour at all.
@phocks try this version (requires php>=7.0.0): https://github.com/matjazpotocnik/ProcessWire-AIOM-All-In-One-Minify/
I have a script like this:
The space between the
<strong>
and the<span>
tags is deliberate and should be preserved as a literal space character in the paragraph. But when the "HTML minify" option is on the space character between these tags is stripped out. The same problem occurs if I have an<a>
tag after my<strong>
tag.