Swaagie / minimize

Minimize HTML
MIT License
162 stars 18 forks source link

HTML minification eats up spaces between inline elements #66

Closed kilianc closed 9 years ago

kilianc commented 9 years ago
<div>Foo <div class="display: inline-block;">Bar</div></div>

will yield

<div>Foo<div class="display: inline-block;">Bar</div></div>
Swaagie commented 9 years ago

This is working as expected as I've got no way to tell if div is an inline element. By default div is a block level element and should not need flowing spaces. That said there are two fixes possible.

Swaagie commented 9 years ago

Almost forgot you could also write a plugin that parses the inline styles for the element and determines if it is inline or not, this is beyond the scope of the main project though

kilianc commented 9 years ago

Yeah @Swaagie , I think I will use this to write more semantic code, there is no reason to use a div there..