Reputation: 1902
Is there a way to avoid having to do this?
{{-''-}} <h2>{{- title -}}</h2>
{{-''-}} <div class="blah">
{{-''-}} {{- blah -}}
{{-''-}} <div class="ha">
{{-''-}} {{- text -}}
{{-''-}} </div>
{{-''-}} </div>
Upvotes: 0
Views: 182
Reputation: 46573
From comments:
There's a Jinja2 extension called HTMLCompress. Its Github page.
Follow the instructions to install it and then wrap parts of markup you want to compress in {% strip %}
block:
{% strip %}
<div>
Whitespace will be removed
</div>
{% endstrip %}
Upvotes: 3