-
-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
Description
- I'm on the latest version of djLint
- I've searched the issues
- I've read the docs
System Info
- OS: Debian 13
- Python Version (
python --version
): Python 3.13.2 - djLint Version (
djlint --version
): djlint, version 1.36.4 - template language: Jinja2
Issue
Content of the Hyperscript attribute _
is always reduced to single line.
How To Reproduce
Try formatting this snippet:
<button class="whatever"
hx-post="{{ url_for("some.path") }}"
hx-headers='{
"X-CSRFToken": "{{ csrf_token() }}"
}'
_="on htmx:afterRequest
if event.detail.xhr.status == 200
set me.disabled to true
else
set me.disabled to false">
Refresh search index
</button>
Result:
<button class="whatever"
hx-post="{{ url_for("some.path") }}"
hx-headers='{ "X-CSRFToken": "{{ csrf_token() }}" }'
_="on htmx:afterRequest if event.detail.xhr.status == 200 set me.disabled to true else set me.disabled to false">
Refresh search index
</button>
I can understand the single-line hx-*
, but joined _
is not great.
There can be more logic and having it all in single line makes code properly unreadable.
Notes
Might be related to #723
adamjhf