diff --git a/src/djlint/settings.py b/src/djlint/settings.py index f30a9a7..5574046 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -14,7 +14,7 @@ ignored_block_closing = [r"", r"", r"#}[^\}]", r"", r"#}", r" """ ) + + +def test_dj_comments_tag(runner, tmp_file): + write_to_file( + tmp_file.name, + b"""{# comment #}\n{% if this %}
{% endif %}""", + ) + runner.invoke(djlint, [tmp_file.name, "--reformat"]) + assert ( + open(tmp_file.name).read() + == """{# comment #}\n{% if this %}{% endif %}\n""" + )