djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
688 stars 84 forks source link

[BUG] [Linter] Closing tag </script> reported as orphan #142

Closed dyve closed 2 years ago

dyve commented 2 years ago

System Info

Issue

HTML script closing tag reported as orphan.

How To Reproduce

Lint this template:

{% load static %}
<script src="{% static "folder/foo.js" %}?version={% some_version %}"></script>

Note that the </script> (closing) tag is reported as an orphan.

H025 2:71 Tag seems to be an orphan. </script>

Configuration

# pyproject.toml
[tool.djlint]
# Reference: https://djlint.com/djlint/rules.html
profile = "django"
ignore = "H017,H019,T003,T002,H023,H014,H008,T028,H021,T001,H006,H013,H022"
blank_line_after_tag = "load,extends,include"
max_line_length = 120
dyve commented 2 years ago

Thanks @christopherpickering

christopherpickering commented 2 years ago

no problem, please keep creating issues :)

dyve commented 2 years ago

Will do. Have thought about creating a "black for templates" multiple times, but decided that it was not for me. Happy to contribute though. Hope that this becomes a huge success. I found djlint when looking for Django template reformatting for VS Code.

christopherpickering commented 2 years ago

Thanks, yeah, it works for me at least - I couldn't find anything decent either. Templates are very tedious to link and format as there are so many different ways to do the same thing. PR's are more than welcome!

christopherpickering commented 2 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: