mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-09 00:30:59 +00:00
parent
98dd52e488
commit
e531701238
2 changed files with 14 additions and 3 deletions
|
|
@ -627,8 +627,8 @@ class Config:
|
|||
| (?:[^\s]+?=(?:\".*?\"|\'.*?\'))
|
||||
| required
|
||||
| checked
|
||||
| [\w|-]+
|
||||
| [\w|-]+=[\w|-]+
|
||||
| (?:\w|-|\.)+
|
||||
| (?:\w|-|\.)+=(?:\w|-)+
|
||||
| {{.*?}}
|
||||
| {%.*?%}
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ run::
|
|||
|
||||
for a single test, run::
|
||||
|
||||
pytest tests/test_django.py::test_comment --cov=src/djlint \
|
||||
pytest tests/test_django.py::test_alpine_js --cov=src/djlint \
|
||||
--cov-branch --cov-report xml:coverage.xml --cov-report term-missing
|
||||
|
||||
"""
|
||||
|
|
@ -54,6 +54,17 @@ def test_reformat_asset_tag(runner: CliRunner, tmp_file: TextIO) -> None:
|
|||
assert output.exit_code == 1
|
||||
|
||||
|
||||
def test_alpine_js(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
output = reformat(
|
||||
tmp_file, runner, b"""<div id="collapse"
|
||||
x-data="{ show: true }"
|
||||
x-show="show"
|
||||
x-transition.duration.500ms></div>"""
|
||||
)
|
||||
|
||||
assert output.exit_code == 0
|
||||
|
||||
|
||||
def test_autoescape(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
output = reformat(
|
||||
tmp_file, runner, b"{% autoescape on %}{{ body }}{% endautoescape %}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue