voku / HtmlMin

:clamp: HtmlMin: HTML Compressor and Minifier via PHP
MIT License
161 stars 22 forks source link

v2.0.2 Multiple horizontal whitespace characters not collapsed #15

Closed Bilge closed 6 years ago

Bilge commented 6 years ago

The compressed output does not contain any vertical whitespace (e.g. newlines \r or \n) but does contain many runs of multiple horizontal whitespace characters.

            <form>
                <button>foo</button>
                <input type="hidden" name="bar" value="baz">
            </form>

Becomes:

<form><button>foo</button>  <input name=bar type=hidden value=baz></form>

Note that there are two spaces instead of one between </button> and <input.

This problem is endemic: it's all over the compressed file and not limited to just two spaces; sometimes there are three or more. Clearly all such cases should be compressed to a single space.