7 ms·
Not sure if this is the case or not, but certain templating systems make it really hard to remove extra whitespace/lines (I'm looking at you Jinja2) and they ge
by calloc 14y ago
Not sure if this is the case or not, but certain templating systems make it really hard to remove extra whitespace/lines (I'm looking at you Jinja2) and they get added when you use standard templating stuff like "if/then" statements.
Removing them after the fact with a HTML tidier would work, or you could just not care and let gzip handle the compression.
- irahul 14y ago> Not sure if this is the case or not, but certain templating systems make it really hard to remove extra whitespace/lines (I'm looking at you Jinja2) Jinja2 is a generic templating engine, and as such can't make assumptions about relevance of whitespace. However, writing an extension on top of it isn't hard, and mitsuhiko has written an extension to do that. https://github.com/mitsuhiko/jinja2-htmlcompress https://github.com/mitsuhiko/jinja2-htmlcompress
- calloc 14y agoNice! Going to integrate this into my blogofile setup so that I can output nicer HTML!