rtts / djhtml

Django/Jinja template indenter
GNU General Public License v3.0
582 stars 32 forks source link

Incorrect indentation in places involving multiple template tags #37

Closed apoorvaeternity closed 3 years ago

apoorvaeternity commented 3 years ago

Hey folks,

I am using this library as a pre-commit hook already. It works really well in most places. I am just hitting an issue mostly around the code involving django_components as it uses a lot of template tags.

Here's an example:

{% component_block "instruction" border_top=True header="Login" %}
    {% slot "body" %}
      {% with "login --token="|add:token as content %}
        {% component "copy_field" field_selector="token-field" content=content %}
        {% endwith %}
      {% endslot %}
    {% endcomponent_block %}

As you can see the endwith tag has unneeded indentation and same with the other end... tags.

apoorvaeternity commented 3 years ago

Sorry. GitHub was down while I was posting this issue. Didn't know the issue got posted already. Closing in favor of #38 as it's a duplicate.