django-htmlmin
django-htmlmin copied to clipboard
HTML space entities are changed into regular spaces
BeautifulSoup's formatter='html'
should probably be used, although it would be nice not to have all unicode characters converted to entities.
Additionally, space between a button and a another tag like a link is lost.
Example source file:
<!DOCTYPE html>
<html>
<body>
<p>A paragraph with a non-breakable space</p>
<p>And one with various spaces</p>
<a href="#">A link</a>
<button>A button</button>
</body>
</html>
Minified output:
<!DOCTYPE html><html><head></head><body><p>A paragraph with a non-breakable space</p><p>And one with various spaces</p><a href="#">A link</a><button>A button</button></body></html>
Pictures (input on the left, output on the right):
Agreed, 's should not be removed.
I also would prefer that
's not be removed. Can't use this actually until that happens (well, not without adding a padding style everywhere I want to just put a space).
They seem fine to me. I explicitly give
entities in my .po
language files, and then with or without the middleware they're coming through for me as hard space characters, which have the same effect as the entity which represents them.