djLint
djLint copied to clipboard
[FEATURE]Is it possible to add a function to fix H017 automatically?
Feature Request
Djlint outputs H017 for the following code.
Tag should be self closing. (H017)
<img src="{% static 'img/item02.png' %}">
I want this to be automatically corrected as follows.
<img src="{% static 'img/item02.png' %}" />
H017 happens frequently and I think it's okay to fix it automatically. Will djlint provide the ability to fix this automatically?
Its definitely a nice idea.. fix linter errors vs reformatting the entire file 👍🏽
Hi @christopherpickering :)
Wanted to bring https://github.com/mdn/content/pull/17138 to your attention in relation to this feature request. The original PR was based on H017 from djlint, with the consensus being that this is an XHTML convention that is incorrectly being applied to HTML5.
Result was this pattern being removed from the remaining instances in the Mozilla Developer Network learning area in https://github.com/mdn/django-locallibrary-tutorial/pull/106 and https://github.com/mdn/content/pull/17149.
Thanks for pointing that out. I agree its not needed, It's a matter of personal preference in the end. Thanks!
Also see https://github.com/Riverside-Healthcare/djLint/issues/372
Sorry for the delay, this should be in the next release.
:tada: This issue has been resolved in version 1.26.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
thank you! I haven't tried it yet, but I'm sure it will be very easy to use. I hope djlint keeps getting better and better.