html-minify icon indicating copy to clipboard operation
html-minify copied to clipboard

Collapses white spaces

Open ntopulos opened this issue 9 years ago • 4 comments

html-minify collapses white spaces in many places, I don't see the patern, but the regexp that is behind has to be faulty. To recreate the bug I would suggest to copy the html code from some big web pages, minify it and then compare the resulting minified HTML interpreted by a browser with the original one.

ntopulos avatar Jan 21 '16 09:01 ntopulos

do you have some example? i cant see the problem.

yocmen avatar Jan 21 '16 13:01 yocmen

The project where the problem happens uses a lot of nesting, it also includes JavaScript inside HTML and uses tedious/JShrink to minify this JavaScript.

Unfortunately I was unable to reproduce this issue on a clean Laravel project by copying the HTML code and minifying it.

ntopulos avatar Feb 08 '16 14:02 ntopulos

I have the same issue.

I have a few examples in which the space is removed when minified:

<h1>
      {{ config('app.name') }} {{ $name }}
</h1>
<div>
    <strong>Key:</strong> Value
</div>

Malika- avatar Mar 02 '17 12:03 Malika-

I have this happen too, as a fix for now I use &nbsp; to deny this collapse.

GregPeden avatar Jan 24 '19 21:01 GregPeden