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] Edge case where closing tag not aligned with opening tag #640

Closed
timobrembeck opened this issue May 11, 2023 · 2 comments
Labels

Comments

@timobrembeck
Copy link
Contributor

System Info

  • OS: Arch Linux
  • Python Version: 3.11.3
  • djLint Version: v1.20.0 and above
  • template language: Django

Issue

There seems to be a weird edge case where the closing tag is not aligned with the opening tag.

How To Reproduce

In versions v1.19.7 and below, the following fragment was formatted correctly:

<h1>
    {% if condition1 %}<span class="cls"></span>{% endif %}
    {% if condition2 %}"{{ text }}"{% endif %}
</h1>

In versions v1.20.0 and above (up until the current version v1.27.0), it is formatted like this:

<h1>
    {% if condition1 %}<span class="cls"></span>{% endif %}
    {% if condition2 %}"{{ text }}"{% endif %}
    </h1>
@timobrembeck timobrembeck added 🦠 bug Something isn't working 🧽 formatter labels May 11, 2023
@christopherpickering
Copy link
Contributor

Odd stuff, its something w/the quotes in the second if statement. I'll check that out!

christopherpickering pushed a commit that referenced this issue May 11, 2023
## [1.27.2](v1.27.1...v1.27.2) (2023-05-11)

### Bug Fixes

* **formatter:** fixed an edge case wild regex grab ([0d57e75](0d57e75)), closes [#640](#640)
* **formatter:** fixed formatting of plural tag in blocktrans ([92c083b](92c083b)), closes [#641](#641)
* **formatter:** fixed js/css being formatted even inside ignored blocks ([cbf5796](cbf5796)), closes [#613](#613)
* **linter:** fixed a few false positives/missing positives, added tests ([30f8d31](30f8d31)), closes [#643](#643) [#642](#642)
* **linter:** fixed false postive in alpinejs tags for H037 ([6520f63](6520f63)), closes [#639](#639)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.27.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants