djLint
djLint copied to clipboard
[BUG] [Formatter] Incorrect indentation with template tags which do not have a {% endtag %}
- [ X] I'm on the latest version of djLint
- [ X] I've searched the issues
- [ X] I've read the docs
System Info
- OS: Debian Bookworm
- Python Version (
python --version): 3.12.2 - djLint Version (
djlint --version): 1.36.4 - template language: e.g. mustache: Django
Issue
Template tags do not format as expected if there is a template tag with no explicit ending tag;
{% if album.owner.profile_picture %}
{% thumbnail "250x250" album.owner.profile_picture -- alt="Album owner profile image" class="rounded-full w-24 h-24" %}
{% else %}
<img src="{% static 'svg/icon-user-default.svg' %}"
alt="user"
class="rounded-full w-24 h-24">
{% endif %}
Everything from {% else %] through {% endif %} should be dedented one level. This then continues to throw off the formatting throughout the rest of the html afterwards.
While I saw it previously, and not technically the same in how we are reporting it, it looks like this is the same issue as #1113
Was just checking on the status and saw #168 called out at the top of the issues now which will resolve this.