djLint
djLint copied to clipboard
[BUG] [Formatter] Template Variable in HTML Attribute gets formatted to multi-lines
- [x] I'm on the latest version of djLint
- [x] I've searched the issues
- [x] I've read the docs
System Info
- OS: osx 15.3 M1
- Python Version (
3.12.8) - djLint Version (
1.36.4) - template language: e.g. Django standard
Issue
Latest formatter breaks up html attributes if there is a Template Variable {{ }} i.e. data-{{st_controller}}-target
How To Reproduce
input:
<input type="file" name="file" class="d-none" data-{{ st_controller }}-target= "documentFile" multiple />
output:
<input type="file"
name="file"
class="d-none"
data-
{{ st_controller }}
-target="documentFile"
multiple />
expected:
<input type="file"
name="file"
class="d-none"
data-{{ st_controller }}-target="documentFile"
multiple />
Specifically data-{{st_controller}}-target needs to remain on one line.