djLint
djLint copied to clipboard
[BUG] [Formatter] HTML comments are not indented
- [x] I'm on the latest version of djLint
- [x] I've searched the issues
- [x] I've read the docs
System Info
- OS: Ubuntu 20.04 5.15.79.1-microsoft-standard-WSL2
- Python Version 3.10.9
- djLint Version 1.19.15
- template language: Django
Issue
HTML comments are not indented.
How To Reproduce
Create a new template:
<div>
<!-- this is a comment
with multiple lines
-->
</div>
Format gives this output:
<div>
<!-- this is a comment
with multiple lines
-->
</div>
Expected it to give something like:
<div>
<!-- this is a comment
with multiple lines
-->
</div>
Hi @leetrout, comments contents are intentionally ignored. Is there a good case for formatting them?
I would expect the closing tag and inner contents to align with the indentation of the opening tag when it is a multiline comment based on the behavior of other popular formatters and how HTML comments are often used deep inside several markup tags.