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]No whitespace when reformatting with rule disabled #316

Closed
andr3h3nriqu3s11 opened this issue Aug 1, 2022 · 1 comment
Labels

Comments

@andr3h3nriqu3s11
Copy link

andr3h3nriqu3s11 commented Aug 1, 2022

System Info

  • OS: MacOS 12.4
  • Python Version 3.10.4
  • djLint Version 1.7.4
  • template language: html

Issue

Using {# djlint:off #} prevents disables the whitespace at the beginning of the line when running --reformat

How To Reproduce

Initial file:

<div>
<div>
{{ test }}
</div>
</div>

which is formatted to, after running djlint <filename> --reformat:

<div>
    <div>{{ test }}</div>
</div>

But after adding turning of the rule

{# djlint:off H021 #}
<div>
<div>
{{ test }}
</div>
</div>
{# djlint:on #}

Formating still happens but the whitespace is not added:

{# djlint:off H021 #}
<div>
<div>{{ test }}</div>
</div>
{# djlint:on #}

Expected:

{# djlint:off H021}
<div>
    <div>{{ test }}</div>
</div>
{# djlint:on #}
@andr3h3nriqu3s11 andr3h3nriqu3s11 added 🦠 bug Something isn't working 🧽 formatter labels Aug 1, 2022
@andr3h3nriqu3s11 andr3h3nriqu3s11 changed the title [BUG] [Formatter] [BUG] [Formatter]No whitespace when reformatting with rule disabled Aug 1, 2022
christopherpickering pushed a commit that referenced this issue Aug 1, 2022
## [1.9.3](v1.9.2...v1.9.3) (2022-08-01)

### Bug Fixes

* **formatter:** fix to prevent formatter from breaking malformed attribute tags ([80263b2](80263b2)), closes [#317](#317)
* **linter:** disabling linter rules should not disable formatting ([69ef16a](69ef16a)), closes [#316](#316)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.9.3 🎉

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