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

Space removed from between inline elements #1134

Open StreamedLine opened 2 years ago

StreamedLine commented 2 years ago

(comment edited for clarity) Hi,

My issue: space getting removed from between spans if span contains <%= someVar %>

To reproduce: https://kangax.github.io/html-minifier/ with only Collapse-Whitespace and HTML5 selected

<span></span> <span></span> -> space doesn't get removed <span><%= str %></span> <span></span> -> becomes <span><%= str %></span><span></span>

Is this a bug or am I missing something?

Much thanks! David