From 6c2d843c2f4fb1dd482a5fde36a56f17869b7449 Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Wed, 9 Nov 2022 15:08:58 +0100 Subject: [PATCH] fix(formatter): fixed a few broken alpinejs attributes closes #448 --- src/djlint/settings.py | 2 +- tests/test_html/test_alpinejs.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/djlint/settings.py b/src/djlint/settings.py index cf0cfbd..be456f3 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -506,7 +506,7 @@ class Config: rf""" (?: ( - (?:\w|-|\.)+ | required | checked + (?:\w|-|\.|\:|@)+ | required | checked )? # attribute name (?: [ ]*?=[ ]*? # followed by "=" ( diff --git a/tests/test_html/test_alpinejs.py b/tests/test_html/test_alpinejs.py index 26ee25c..7f42a28 100644 --- a/tests/test_html/test_alpinejs.py +++ b/tests/test_html/test_alpinejs.py @@ -23,7 +23,10 @@ def test_alpine_js(runner: CliRunner, tmp_file: TextIO) -> None: b"""
""", + x-transition.duration.500ms + :disabled="!$store.userPreferences.deleteConfirm" + @click="clicked=true"> +""", ) assert output.exit_code == 0