diff --git a/src/djlint/rules.yaml b/src/djlint/rules.yaml index 420ec44..11ab245 100644 --- a/src/djlint/rules.yaml +++ b/src/djlint/rules.yaml @@ -210,15 +210,9 @@ - "{{((?:(?!\"|}}).)*?(\")(?:(?!\\2|}}).)*?\\2(?:(?!\\2|}}).)*?)*\\2(?:(?!\\2|}}).)*?}}" # for tags with a single quote - # for double quotes - - "{%((?:(?!\"|%}).)*?(\")(?:(?!\\2|%}).)*?)%}" - # for single quotes - - "{%((?:(?!'|%}).)*?(')(?:(?!\\2|%}).)*?)%}" + - "{%((?:(?!'|\"|%}).)*?('|\")(?:(?!\\2|%}).)*?)%}" + - "{{((?:(?!'|\"|}}).)*?('|\")(?:(?!\\2|}}).)*?)}}" - # for double quotes - - "{{((?:(?!\"|}}).)*?(\")(?:(?!\\2|}}).)*?)}}" - # for single quotes - - "{{((?:(?!'|}}).)*?(')(?:(?!\\2|}}).)*?)}}" - rule: name: T028 message: Consider using spaceless tags inside attribute values. {%- if/for -%} diff --git a/tests/test_linter/test_linter.py b/tests/test_linter/test_linter.py index f9f3081..7168b40 100644 --- a/tests/test_linter/test_linter.py +++ b/tests/test_linter/test_linter.py @@ -590,7 +590,7 @@ def test_T027(runner: CliRunner, tmp_file: TextIO) -> None: tmp_file.name, b'{% trans "Check box if you\'re interested in this location." %}', ) - result = runner.invoke(djlint, [tmp_file.name]) + result = runner.invoke(djlint, [tmp_file.name, "--profile", "django"]) assert "T027" not in result.output # test mixed quotes