Closed janbaykara closed 1 year ago
Any chance you can share your config? Have you added fragment
as a custom block?
thanks!
the fragment
tag should be in the config:
[tool.djlint]
profile = "django"
use_gitignore = true
ignore="H006,H031" # Ignore img width/height requirements
custom_blocks="fragment"
Does that work for you? Thanks for linking the slippers docs, we can probably include thier tags in the default set.
I see, I didn't realise one had to specify tags for them to be formatted... I assume this won't be necessary after the reimplementation of DJLint with an AST?
The tags included with django/jinja/twig/etc are formated by default but custom tags need to be specified right now. We will see what happens in the next edition... still working on that code.
I feel like, for a Django project, given that all of my HTML will be interpreted through the Django template engine, I'd expect all {% ... %} ... {% ... %}
syntax to be nested without exception.
I wonder if this warrants a general flag being added to the config, if you are running a Django project? Potentially, alternatively, a file-level comment flag.
well, there are also {% %}
tags that are not indented, for example the include and load tags... but I supposed if there is an {% end...
trailing it, then the contents could be indented.
That makes sense!
:tada: This issue has been resolved in version 1.19.17 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
System Info
Issue
Custom template tags provided by slippers are incorrectly indented.
When I write code like this:
djlint auto-formats it to this:
How To Reproduce
slippers