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

fix #1052: template tag inside template tag #1053

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

oliverhaas
Copy link
Contributor

@oliverhaas oliverhaas commented Nov 30, 2024

Pull Request Check List

Resolves: #1052

  • Added tests for changed code.
  • Updated documentation for changed code.
    (no real need to update docs)

This is a quick fix.

Overall I think djlint should be refactored in some regards.

Many regexes (like this one I modified) should be using existing basic regexes as building blocks more I think.
Many regexes don't respect nesting of brackets and escaping properly (again, like this one here), and do not respect the differences between what e.g. an attribute key or value.

Both these issues rarely matter, but I could definitely construct valid django templates where they do. Not super easy to fix/refactor, so I'm currently trying to cover some ground with these smaller issues/PRs and get some tests for all of my use cases, so I'm maybe confident enough to refactor some stuff later.

Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for djlint canceled.

Name Link
🔨 Latest commit 0fe8550
🔍 Latest deploy log https://app.netlify.com/sites/djlint/deploys/67516a3e26a87e0008676ea9

@oliverhaas oliverhaas changed the title fix: template tag inside template tag fix #1052: template tag inside template tag Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [Formatter] Template tags inside template tags (e.g. when using django-components)
1 participant