Open malo-malo opened 1 year ago
The </script>
part seems to be similar to this issue https://github.com/Riverside-Healthcare/djLint/issues/697
Note to self for future fix..
the error is coming in formatter/condense.py. The strip_space function allows updates if we are a safe closing tag. This should only happen if we are not inside another ignored...
Add old example from #569 😢
and after enable {% comment %} djlint:on {% endcomment %}
, something html tag will be abnormally indented
https://djlint.com/demo/ Python 3.10.2; djLint 1.31.1
<nav class="navbar navbar-expand-lg navbar-light bg-light main-nav p-3">
<div class="collapse navbar-collapse" id="navBar">
<div class="navbar-nav ml-auto">
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle mr-4"
href="#"
id="navbarDropdownMenuLink"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
{{ request.user.name }}
</a>
<div class="dropdown-menu"
style="min-width: 105px;
width: 105px"
aria-labelledby="navbarDropdownMenuLink">
{% comment %} djlint:off {% endcomment %}
<a class="dropdown-item"
href="http://user/login">變更密碼</a>
{% comment %} djlint:on {% endcomment %}
</div>
</li>
</ul>
</div>
</div>
</nav>
I reopened the other as this is probably more relevant there 👍🏼 thanks for reporting!
System Info
Issue
Followup on this issue https://github.com/Riverside-Healthcare/djLint/issues/655 Most cases have been fixed, but some parts of supposedly ignored templates are still being formatted.
How To Reproduce
Here is a list of the problems I have encountered and that I reproduced in the online version, with the default configuration:
</style>
or</script>
tag gets un-indented{% endcomment %}
get un-indentedblocktranslate trimmed
seems to have an influence on the formatting of following lines, in the entire file (theblocktranslate
and<a>
lines are a minimal reproduction)