djLint
djLint copied to clipboard
[BUG] [Linter] Cache is not among default block tags
- [x] I'm on the latest version of djLint
- [x] I've searched the issues
- [x] I've read the docs
System Info
- OS: e.g. ubuntu 23.10
- Python Version: Python 3.11.6
- djLint Version: djlint, version 1.34.1
- profile: django
Issue
djlint is not treating cache
as block tag:
<body>
{% block top_navbar %}
{% cache 600 %}
{% endcache %}
{% endblock top_navbar %}
</body>
Would be reformated by djlint blenderhub/templates/base.html --reformat --profile=django
to:
<body>
{% block top_navbar %}
{% cache 600 %}
{% endcache %}
{% endblock top_navbar %}
</body>
The {% cache %}
is official Django block tag: https://docs.djangoproject.com/en/5.0/topics/cache/
How To Reproduce
See above. With settings custom_blocks="cache"
the reformat works as expected.j
Contents of .djlintrc/pyproject.toml [tool.djlint]
[tool.djlint]
profile="django"
# custom_blocks="cache"