Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Formatter] Incorrect indentation with template tags which do not have a {% endtag %} #1161

Open
jmichalicek opened this issue Feb 26, 2025 · 2 comments
Labels
🦠 bug Something isn't working 🧽 formatter

Comments

@jmichalicek
Copy link

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.

@jmichalicek jmichalicek added 🦠 bug Something isn't working 🧽 formatter labels Feb 26, 2025
@jmichalicek
Copy link
Author

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

@jmichalicek
Copy link
Author

Was just checking on the status and saw #168 called out at the top of the issues now which will resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦠 bug Something isn't working 🧽 formatter
Projects
None yet
Development

No branches or pull requests

1 participant