diff --git a/src/djlint/settings.py b/src/djlint/settings.py index 6c4c66d..aedd156 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -627,8 +627,8 @@ class Config: | (?:[^\s]+?=(?:\".*?\"|\'.*?\')) | required | checked - | [\w|-]+ - | [\w|-]+=[\w|-]+ + | (?:\w|-|\.)+ + | (?:\w|-|\.)+=(?:\w|-)+ | {{.*?}} | {%.*?%} """ diff --git a/tests/test_django.py b/tests/test_django.py index c4d4e79..a8eae93 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -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"""
""" + ) + + assert output.exit_code == 0 + + def test_autoescape(runner: CliRunner, tmp_file: TextIO) -> None: output = reformat( tmp_file, runner, b"{% autoescape on %}{{ body }}{% endautoescape %}"