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] for template tags getting formatted to one line #1057

Open
3 tasks done
fuyu-dymocks opened this issue Dec 3, 2024 · 0 comments
Open
3 tasks done
Labels
🦠 bug Something isn't working 🧽 formatter

Comments

@fuyu-dymocks
Copy link

fuyu-dymocks commented Dec 3, 2024

System Info

  • OS: e.g. macos 14.6.1
  • Python Version (python --version) 3.12.7
  • djLint Version (djlint --version) 1.36.3
  • template language: django

Issue

This block of code gets collapsed to one line

        {% for class in classes %}
            console.log("{{ class }}")
        {% endfor %}

i.e.
{% for class in classes %}console.log("{{ class }}"){% endfor %}

which results in a syntax error.

I've tried a bunch of configurations but can't seem to stop this behaviour.

I am using djlint in a pre-commit hook to lint and format my code.

Trying to ignore the section of code using djlint:off doesn't work either, it just gets formatted regardless.

[tool.djlint]
profile = "django"
ignore = "H031,T003,H021,H030,H005,H006,D018,H023,H019"
indent_size=2
@fuyu-dymocks fuyu-dymocks added 🦠 bug Something isn't working 🧽 formatter labels Dec 3, 2024
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