-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting on "/>" in HTML attributes
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Test for _hyperscript. | ||
uv run pytest tests/test_html/test_hyperscript.py | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
import pytest | ||
|
||
from djlint.reformat import formatter | ||
from tests.conftest import printer | ||
|
||
if TYPE_CHECKING: | ||
from djlint.settings import Config | ||
|
||
test_data = [ | ||
pytest.param( | ||
( | ||
"<div _='on click increment :x then put it into the <output/> in me'>\n" | ||
" Clicks:\n" | ||
" <output>0</output>\n" | ||
"</div>\n" | ||
), | ||
( | ||
"<div _='on click increment :x then put it into the <output/> in me'>\n" | ||
" Clicks:\n" | ||
" <output>0</output>\n" | ||
"</div>\n" | ||
), | ||
id="html_tags_in_attributes", | ||
) | ||
] | ||
|
||
|
||
@pytest.mark.parametrize(("source", "expected"), test_data) | ||
def test_base(source: str, expected: str, basic_config: Config) -> None: | ||
output = formatter(basic_config, source) | ||
|
||
printer(expected, source, output) | ||
assert expected == output |