cobrateam / django-htmlmin

HTML minifier for Python frameworks (not only Django, despite the name).
http://pypi.python.org/pypi/django-htmlmin
BSD 2-Clause "Simplified" License
542 stars 73 forks source link

Too aggressive? #108

Closed rosskarchner closed 6 years ago

rosskarchner commented 8 years ago

This seems sort of wrong to me (using the latest release):

>>> str= "<b>hey </b>you"                                                                                                      
>>> html_minify(str)
u'<html><head></head><body><b>hey</b>you</body></html>'
>>> 

which would render like "heyyou", when the intent would pretty clearly be "hey you"

andrewsmedina commented 8 years ago

Hi @rosskarchner it's looks like a bug. The minify should not remove the space inside tag.

Ryuno-Ki commented 7 years ago

Affects us, too. Even with v0.10.0.

@andrewsmedina Can you at least point to the line in source code where the minification happens? Workaround using EXCLUDE_FROM_MINIFYING is too fragile with Django's URL routing IMHO …

Ryuno-Ki commented 7 years ago

Using undocumented EXCLUDE_TAGS_FROM_MINIFYING is usable as workaround.

andrewsmedina commented 7 years ago

We should document EXCLUDE_TAGS_FROM_MINIFYING setting

rosskarchner commented 7 years ago

so , EXCLUDE_TAGS_FROM_MINIFYING would solve my example above, if I add 'b' to that list?

Ryuno-Ki commented 7 years ago

What does your python shell tell you? :-)