junstyle / vscode-django-support

django formatter, highlight...
https://marketplace.visualstudio.com/items?itemName=junstyle.vscode-django-support
Apache License 2.0
4 stars 0 forks source link

Formatting Issues #7

Closed bassyeung closed 11 months ago

bassyeung commented 1 year ago

When I tried to format my code, I encountered some errors, such as:

<div class="{% if rounded %}rounded{% endif %} {% if classes %}{{ classes }}{% endif %}">
<img class="file-icon" src="{% static "common/images/icons/image.svg" %}" alt="asset preview">

These errors indicate: ERROR: Invalid Token. Expected stringEnd but found tag start "{%" instead.

{% include 'users/components/avatar.html' with user=request.user %}

These errors indicate: ERROR: Invalid Token. Expected tag end "%}" but found = instead.

junstyle commented 1 year ago

can't use {% ... %} in html property. only {{ ... }} allowed

or refer this issue https://github.com/junstyle/vscode-django-support/issues/5

and the second =, i don't know this in django, you can comment that line to ignore the errors

junstyle commented 11 months ago

a new version has been published, now you can use {%...%} in html property value d462fcc51610a5e685dd14510c518216e32286dc