djLint
djLint copied to clipboard
[BUG] [Formatter] Incorrect indentation around `timezone` tags
- [ ] I'm on the latest version of djLint
- [ ] I've searched the issues
- [ ] I've read the docs
System Info
- macOS Sonoma 14.2.1
- Python 3.10.11
- djLint 1.34.1
- template language: Django
Issue
The formatter incorrectly indents around timezone tags.
How To Reproduce
The following code pasted into a template
<div>
<div>
{% timezone object.zone_info %}
<p>{% now "F jS, Y h:i A e" %}</p>
{% endtimezone %}
</div>
</div>
Indents like so
<div>
<div>
{% timezone object.zone_info %}
<p>{% now "F jS, Y h:i A e" %}</p>
{% endtimezone %}
</div>
</div>
Note: I was able to resolve this by adding custom_blocks = "timezone"
to pyproject, but this is a Django feature and should be internally recognized by djlint
@samamorgan I am having the same issue with blocktrans, but setting custom_blocks = "blocktrans" doesn't do anything for me. Is it the same for you?