djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
686 stars 84 forks source link

[FEATURE] [Formatter] sorl-thumbnail's django template tag indentation #714

Closed josvleeuwen closed 1 year ago

josvleeuwen commented 1 year ago

System Info

Issue

When I use sorl-thumbnail to generate a thumbnail of an image with this code the formatter messes up the indentation:

    // <-- 4 spaces
    {% thumbnail person.profile_photo "200x200" crop="center" as im %}
    <img src="{{ im.url }}"
         width="{{ im.width }}"
         height="{{ im.height }}"
         class="img-thumbnail"
         alt="{{ person.name }}">
{% endthumbnail %}
// <-- 0 spaces

How To Reproduce

Copy & paste the code above.

welcome[bot] commented 1 year ago

Thanks for opening your first issue here!

christopherpickering commented 1 year ago

Hey, can you add your config? Did you add thumbnail as a custom block in it?

christopherpickering commented 1 year ago

@josvleeuwen I will add support for this in the next release. Thanks!

christopherpickering commented 1 year ago

:tada: This issue has been resolved in version 1.32.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: