New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [Linter] H025 False positive when trans tag contains one single quote #447
Comments
Attribute parsing is gonna kill me lol. I'll put out a fix shortly. I'm working hard on an update that will get rid of most regex 😅 |
To fix this issue I just moved trans tag out of attributes {% trans "text with ONE single ' quote" as tanslated_text %}
<button title="{{ tanslated_text }}">
</button> |
You've probably already know this, but it's not limited to the <p>
<some-tag
- onclick="window.location.href = '{% url 'app:view' %}'">
+ onclick="window.location.href = '{% url 'app:view' %}">
</some-tag>
</p> Although my guess is that you use a generic, not tag/filter specific, method of counting nested quotation marks. |
@SebastiaanZ @a-edakin thanks! I should have a release out shortly that covers both cases. |
## [1.19.5](v1.19.4...v1.19.5) (2022-11-07) ### Bug Fixes * **linter:** make attribute pattern on H025 more accepting. Prevent false positive ([1bd0bf7](1bd0bf7)), closes [#447](#447)
🎉 This issue has been resolved in version 1.19.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
System Info
Issue
False positive H025 issue if HTML's tag attribute contains
{% trans "some text with ONE single ' quote" %}
.But if I would use second quote then everything would be fine
{% trans "some text with TWO single '' quote" %}
.How To Reproduce
HTML file to reproduce:
Command:
djlint -
Console output:
Contents of .djlintrc/pyproject.toml [tool.djlint]
The text was updated successfully, but these errors were encountered: