Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Formatter] Template Variable in HTML Attribute gets formatted to multi-lines #1185

Open
3 tasks done
nitsujri opened this issue Mar 12, 2025 · 0 comments
Open
3 tasks done
Labels
🦠 bug Something isn't working 🧽 formatter

Comments

@nitsujri
Copy link

nitsujri commented Mar 12, 2025

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.

@nitsujri nitsujri added 🦠 bug Something isn't working 🧽 formatter labels Mar 12, 2025
@nitsujri nitsujri changed the title [BUG] [Formatter] [BUG] [Formatter] Template Variable in HTML Attribute gets formatted to multi-lines Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦠 bug Something isn't working 🧽 formatter
Projects
None yet
Development

No branches or pull requests

1 participant