Forum Discussion
Thanks for that URL Link gary! It does indeed look like taking out the line breaks will work but gosh - that certainly makes for messy code. I wonder if there are any other options where you don't end up with confusing, run on code?
------------------------------
Mike Tamoush
------------------------------
Check the "Whitespace Control" section of this article. It's another way to handle line breaks while maintaining readable code.
https://jinja.palletsprojects.com/en/latest/templates/#whitespace-control
------------------------------
gary
------------------------------
- ShaneMiller12 years agoQrew Cadet
Holy smokes, that worked. Great find! Thank you!
Here is an example of the Jinja2 code that I used based off your recommendation that resolved my white space issue:
{%- if a.tax_id != a.$prev.tax_id -%}
tax id changed from {{ a.$prev.tax_id }} to {{ a.tax_id }}
{% endif %}
adding the - sign after the % and before the % on every if statement resolved my issue.
@Mike @Gary - You both are great. I appreciate y'all for helping me resolve this headache of an issue
------------------------------
Shane Miller
------------------------------- MikeTamoush2 years agoQrew Elite
This one was all Gary. Thanks for all the Jinja tips!
------------------------------
Mike Tamoush
------------------------------