Closed mcoms closed 11 years ago
Thanks for reporting that with the upstream project. I'd suggest using
as a work-around for spaces you really want to keep which minifying hmtl.
np!
Sadly
won't do it, since it then breaks Bootstrap's responsive features.  
is a no-go too, since many browsers (including webkit) fail to render it properly as a breaking character. Yay!
For now, I took the hit of including extra spaces:
activate :minify_html, remove_intertag_spaces: false
Hi, I closed the issue on htmlcompressor but also reporting my thoughts here. remove_intertag_spaces: true behave as intended. At the moment it is not smart enough to preserve spaces around inline tags and this feature at the moment is not planned. For better clarity I'm going to update the rack middleware in the gem changing remove_intertag_spaces to false as the default option since I think it is safer and the consequences of removing all intertag spaces need to be evaluated by the user
For further considerations please see the referenced issue https://github.com/paolochiodi/htmlcompressor/issues/4
Thanks for the clarification, @paolochiodi.
@mcoms, thanks for reporting and debugging, I'm going to close this issue. The solution is documented in this thread and the cost of a couple whitespaces in a world with retina graphics isn't the end of the world.
The following input:
Produces the following output:
The space between
</a>
and<small>
is missing, which affects the content of the page. Note the second line is minified correctly, since it doesn't contain a link.It really messes with Twitter Bootstrap.
/ed: After investigation, this is caused by the following issue: https://github.com/paolochiodi/htmlcompressor/issues/4. Should this gem pass its own set of consistent options?