djLint
djLint copied to clipboard
[BUG] [Linter] Apostroph in string leads to T027
- [x] I'm on the latest version of djLint
- [x] I've searched the issues
- [x] I've read the docs
System Info
- OS: macOS 12.0.1
- Python Version: 3.8.12
- djLint Version: 0.6.1
Issue
Apostroph in string leads to T027 ("Unclosed string found in template syntax").
How To Reproduce
Lint this template
{% load i18n %}
{% trans "Check box if you're interested in this location." %}
Note that this leads to a report:
T027 XX:8 Unclosed string found in template syntax. {% trans "Check box
Configuration
# pyproject.toml
[tool.djlint]
# Reference: https://djlint.com/djlint/rules.html
profile = "django"
ignore = "H017,H019,T003,T002,H023,H014,H008,T028,H021,T001,H006,H013,H022"
blank_line_after_tag = "load,extends,include"
max_line_length = 120
:tada: This issue has been resolved in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
This issue reappeared in https://github.com/Riverside-Healthcare/djLint/commit/946b8ad7152b098ddc2489a52bc668ba48737445.
@monosans ah, thanks, I see in the test it is missing the --profile flag, which is why this test is passing.
:tada: This issue has been resolved in version 1.9.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I am getting similar error with version 1.9.4 when there are odd number (but more than one) of apostrophes. For example:
{% trans "Click 'submit' if you know what you're doing." %}
I get an error Unclosed string found in template syntax. {% trans "Click 'sub (T027).