Open webtic opened 10 years ago
The space between "firstcol" and "cell_style" gets removed when a conditional statement is in-between quotes.
Thus: <th class="{%if loop==1%}firstcol {% endif %} cell_style">
is compressed to:
<th class="firstcolcell_style">
instead of the expected
<th class="firstcol cell_style">
Obviously forcing a space saves the day but I wasn't expecting the removal.
<th class="{%if loop==1%}firstcol{{ " " }}{% endif %} cell_style">
My branch over in https://github.com/eli-collins/jinja2-htmlcompress has a rewritten parser that should take care of this issue; and added your same to the tests
The space between "firstcol" and "cell_style" gets removed when a conditional statement is in-between quotes.
Thus: <th class="{%if loop==1%}firstcol {% endif %} cell_style">
is compressed to:
<th class="firstcolcell_style">
instead of the expected
<th class="firstcol cell_style">
Obviously forcing a space saves the day but I wasn't expecting the removal.
<th class="{%if loop==1%}firstcol{{ " " }}{% endif %} cell_style">