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]If the block contains only comments, it will not be formatted correctly. #265

Closed
3 tasks done
Taikono-Himazin opened this issue Jun 20, 2022 · 3 comments
Closed
3 tasks done
Labels

Comments

@Taikono-Himazin
Copy link

System Info

  • OS: Win10
  • Python Version 3.9.10
  • djLint Version 1.2.0
  • template language: django

Issue

If the block contains only {# some_comment #}, it will not be formatted correctly.

How To Reproduce

{% block some_block %}
    {# comment #}
{% endblock %}
{% block content %}
    {# Title #}
    <div class="row">
        <div class="col text-center">
            <h1 class="pt-2">TOP</h1>
        </div>
    </div>
{% endblock %}

The output result is as follows.

{% block some_block %}{# comment #}{% endblock %}
{% block content %}
{# Title #}
<div class="row">
<div class="col text-center">
<h1 class="pt-2">TOP</h1>
</div>
</div>
{% endblock %}

It works in the following cases:

{% block some_block %}
    {% comment %}{% endcomment %}
{% endblock %}
{% block content %}
    {# Title #}
    <div class="row">
        <div class="col text-center">
            <h1 class="pt-2">TOP</h1>
        </div>
    </div>
{% endblock %}
@Taikono-Himazin Taikono-Himazin added 🦠 bug Something isn't working 🧽 formatter labels Jun 20, 2022
@christopherpickering
Copy link
Contributor

Thanks for reporting this! A new version will be out shortly.

christopherpickering pushed a commit that referenced this issue Jun 21, 2022
## [1.2.1](v1.2.0...v1.2.1) (2022-06-21)

### Bug Fixes

* **curly hash comment:** fix formatting on curly hash comment blocks ([4dc2140](4dc2140)), closes [#265](#265)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.2.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Taikono-Himazin
Copy link
Author

This problem was solved. thank you!

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