html-minifier
html-minifier copied to clipboard
"Collapse inline tag whitespace" doesn't work between <img> elements
When I do:
<div>
<span></span>
<span></span>
</div>
it minifies correctly to <div><span></span><span></span></div> (without a space between the two <span>s).
However, when I replace the <span>s with <img>s:
<div>
<img>
<img>
</div>
it minifies with a space in between: <div><img> <img></div>
Configuration:
{
collapseWhitespace: true,
collapseInlineTagWhitespace: true,
conservativeCollapse: false,
...
}
Actually, the first output (for span) seems incorrect?
But when testing both, e.g.
<!doctype html>
<title>Test</title>
<div>
<span></span>
<span></span>
</div>
<div>
<img src=foo alt>
<img src=foo alt>
</div>
the outcome seem correct for both cases even with the default settings (except with “Remove tag whitespace” off) of html-minifier (and also of HTML Minifier Next):
<!doctype html><title>Test</title><div><span></span> <span></span></div><div><img alt src=foo> <img alt src=foo></div>
Would also speak for HTML Minifier Next but happy to look into any issues there!