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] Formatting breaks on "/>" in HTML attributes #792

Open
3 tasks done
zyzzyxdonta opened this issue Dec 5, 2023 · 1 comment · May be fixed by #1102
Open
3 tasks done

[BUG] [Formatter] Formatting breaks on "/>" in HTML attributes #792

zyzzyxdonta opened this issue Dec 5, 2023 · 1 comment · May be fixed by #1102
Labels
🦠 bug Something isn't working 🧽 formatter

Comments

@zyzzyxdonta
Copy link

zyzzyxdonta commented Dec 5, 2023

System Info

  • OS: Fedora Linux 38 (KDE Plasma)
  • Python Version: Python 3.11.6
  • djLint Version: djlint, version 1.34.0
  • template language: django

Issue

HTML attributes containing the string /> cause unindent in the following lines. This case comes up, e.g. when using hyperscript CSS query selectors.

How To Reproduce

example.html.txt

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="description" content="An example" />
    <meta name="keywords" content="test" />
    <title>Test</title>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
          rel="stylesheet">
    <script src="https://unpkg.com/[email protected]"></script>
  </head>
  <body class="container">
    <div class="row mt-3">
      <div class="col">
        <button id="button-1"
                type="button"
                class="btn btn-primary"
                _="on click toggle .d-none on <#button-2, #button-6/>">Button 1</button>
        <button id="button-2" type="button" class="btn btn-success">Button 2</button>
        <button id="button-3" type="button" class="btn btn-danger">Button 3</button>
      </div>
    </div>
    <div class="row mt-3">
      <div class="col">
        <button id="button-4" type="button" class="btn btn-primary">Button 4</button>
        <button id="button-5" type="button" class="btn btn-success">Button 5</button>
        <button id="button-6" type="button" class="btn btn-danger">Button 6</button>
      </div>
    </div>
  </body>
</html>
@zyzzyxdonta zyzzyxdonta added 🦠 bug Something isn't working 🧽 formatter labels Dec 5, 2023
Copy link

welcome bot commented Dec 5, 2023

Thanks for opening your first issue here!

@novucs novucs linked a pull request Jan 10, 2025 that will close this issue
2 tasks
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

Successfully merging a pull request may close this issue.

1 participant