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] blank_line_after_tag should not add a new line if indent is decreased #827

Open
3 tasks done
lukepass opened this issue Apr 3, 2024 · 0 comments
Open
3 tasks done
Labels
🦠 bug Something isn't working 🧽 formatter

Comments

@lukepass
Copy link

lukepass commented Apr 3, 2024

System Info

  • OS: Ubuntu 20.04
  • Python Version (Python 3.8.10)
  • djLint Version (1.34.1)
  • template language: nunjucks / twig

Issue

When using the option blank_line_after_tag the formatter should not add a new blank line if the line directly after the tag is a closing tag with decreasing indent:

<!DOCTYPE html>
<html lang="it">
    <head>
        <meta charset="UTF-8">
        <title>
            {% block title %}My website{% endblock %} <!-- There should not be a new line after this -->

        </title>
        <link rel="icon" href="{{ asset("logo.ico") }}" type="image/x-icon">
        {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
        {% block stylesheets %}{{ encore_entry_link_tags("app") }}{% endblock %} <!-- Here is OK -->

        {% block javascripts %}{{ encore_entry_script_tags("app") }}{% endblock %} <!-- There should not be a new line after this -->

    </head>
    <body>
        {{ include("shared/_header.html.twig") }}
        <div class="container mx-auto">
            {% block body %}{% endblock %} <!-- There should not be a new line after this -->

        </div>
    </body>
</html>

How To Reproduce

Set blank_line_after_tag to a tag and format the file.

Thanks!

@lukepass lukepass added 🦠 bug Something isn't working 🧽 formatter labels Apr 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