Closed SteveGiralt closed 1 year ago
because the tag <tr>
and </tr>
in different condition block. so you should avoid this situation. make sure start tag and end tag in same block.
Thanks you for your prompt response! This package is a lifesaver! Unfortunately, in this case I can not include both tags in the same condition block. Is there a way to tell the formatter to ignore this so the rest of the file can be formatted?
off course you can ignore that part.
When you are not happy with how Prettier formats a certain element or section in the code, you can tell it to leave it in peace:
{# prettier-ignore #}
<div class="weird-formatting" >This will not be re-formatted</div>
<div class="weird-formatting" >But this will be</div>
You can also tell Prettier to leave entire regions as they are:
{# prettier-ignore-start #}
...
{# prettier-ignore-end #}
Thank you so much
When conditionally rendering a tag in a loop, I get an error which breaks formatting on this template. It renders correctly, so the error must be with the extension.
Example Code: `{% for attachment in question.question_attachments %} {% if forloop.counter0|divisibleby:3 %}
Error:
ERROR: Expected element start. Unexpected closing "tr" tag. Seems like your DOM is out of control.
ScreenShot -![Screenshot 2023-07-05 at 11 59 33 AM](https://github.com/junstyle/vscode-django-support/assets/88471484/ebbd20e6-6e88-4f8b-98d2-d4f9dd1bf582)