kangax / html-minifier

Javascript-based HTML compressor/minifier (with Node.js support)
http://kangax.github.io/html-minifier/
MIT License
4.94k stars 571 forks source link

"Collapse inline tag whitespace" doesn't work between <img> elements #1123

Open alexschcom opened 2 years ago

alexschcom commented 2 years ago

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,
    ...
}