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] CSS/JS formatter indents blank lines #451

Closed
3 tasks done
ad1217 opened this issue Nov 7, 2022 · 1 comment · Fixed by #452
Closed
3 tasks done

[BUG] [Formatter] CSS/JS formatter indents blank lines #451

ad1217 opened this issue Nov 7, 2022 · 1 comment · Fixed by #452
Labels

Comments

@ad1217
Copy link

ad1217 commented Nov 7, 2022

System Info

  • OS: Arch Linux
  • Python Version: 3.10.8
  • djLint Version: 1.19.5
  • template language: django

Issue

Formatting JavaScript or CSS produces indentation on otherwise blank lines, even when js-beautify indent_empty_lines is false.

How To Reproduce

With demo.html:

<html>
    <head>
        <style>
            body {}

            div {}
        </style>
    </head>
    <script>
        let a;

        let b;
    </script>
</html>

Running

pdm run djlint --check --format-js --format-css demo.html

should make no changes, but instead produces:

demo.html
───────────────────────────────────────────────────────────────────────────────
@@ -2,13 +2,13 @@

     <head>
         <style>
             body {}
-
+            
             div {}
         </style>
     </head>
     <script>
         let a;
-
+        
         let b;
     </script>
 </html>

1 file would be updated.
@ad1217 ad1217 added 🦠 bug Something isn't working 🧽 formatter labels Nov 7, 2022
christopherpickering pushed a commit that referenced this issue Nov 8, 2022
## [1.19.6](v1.19.5...v1.19.6) (2022-11-08)

### Bug Fixes

* **css/js:** fixed extra blank lines being appended to blank lines in css/js formatter ([10e593f](10e593f)), closes [#451](#451)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.19.6 🎉

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

Successfully merging a pull request may close this issue.

2 participants