djLint icon indicating copy to clipboard operation
djLint copied to clipboard

[BUG] [Linter] Apostroph in string leads to T027

Open dyve opened this issue 4 years ago • 6 comments

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

dyve avatar Nov 22 '21 13:11 dyve

: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:

christopherpickering avatar Apr 25 '22 14:04 christopherpickering

This issue reappeared in https://github.com/Riverside-Healthcare/djLint/commit/946b8ad7152b098ddc2489a52bc668ba48737445.

monosans avatar Jul 29 '22 06:07 monosans

@monosans ah, thanks, I see in the test it is missing the --profile flag, which is why this test is passing.

christopherpickering avatar Jul 29 '22 12:07 christopherpickering

:tada: This issue has been resolved in version 1.9.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

christopherpickering avatar Jul 29 '22 15:07 christopherpickering

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).

travenin avatar Aug 04 '22 12:08 travenin