djLint
djLint copied to clipboard
[BUG] [Formatter] Incorrect handling of object context var creates a breaking change
- [x] I'm on the latest version of djLint
- [x] I've searched the issues
- [x] I've read the docs
System Info
- OS: Windows 11
- Python Version 3.10
- djLint Version 1.34
- template language: django-jinja
Issue
In Django, it's common to pass object as a context var. If the object is used in {% set %} djlint will treat it as javascript, creating a breaking change:
This should be untouched:
{% set card_title_1 = object %}
Instead this occurs:
{% set card_title_1 = <class 'object'> %}
How To Reproduce
Run the formatter on any html file containing {% set card_title_1 = object %}
Thanks for opening your first issue here!

Possibly a regression of https://github.com/Riverside-Healthcare/djLint/issues/756
I have same problem. using it in twig.
This is also {{ block('content_artists', input) ?? '' }} reformatted as {{ block('content_artists', <built-in function input>) ?? '' }}