From b37cb25792b4160ff22b302318ca8156b0d99f1c Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Thu, 30 Sep 2021 14:24:34 +0200 Subject: [PATCH 1/2] Do not indent the element, it does not permit content --- src/djlint/settings.py | 2 -- tests/test_html.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/djlint/settings.py b/src/djlint/settings.py index eb30358..3c2dbcf 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -227,7 +227,6 @@ class Config: | path | script | style - | source | details | summary ) @@ -287,7 +286,6 @@ class Config: | path | script | style - | source | details | summary ) diff --git a/tests/test_html.py b/tests/test_html.py index 236b833..304f6e4 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -199,3 +199,21 @@ def test_ignored_attributes(runner: CliRunner, tmp_file: TextIO) -> None: json-data='{"menu":{"header":"SVG Viewer","items":[{"id":"Open"}]}}'> """ ) + + +def test_picture_source_img_tags(runner: CliRunner, tmp_file: TextIO) -> None: + write_to_file( + tmp_file.name, + b"""\ +image""", + ) + runner.invoke(djlint, [tmp_file.name, "--reformat"]) + assert ( + Path(tmp_file.name).read_text() + == """ + + image + +""" + ) From 3c71f5b7f1c27f2df42e1e956c49746d5b78e545 Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Thu, 30 Sep 2021 14:28:40 +0200 Subject: [PATCH 2/2] added source to single line tags --- src/djlint/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/djlint/settings.py b/src/djlint/settings.py index 3c2dbcf..022ac49 100644 --- a/src/djlint/settings.py +++ b/src/djlint/settings.py @@ -443,6 +443,7 @@ class Config: link | img | meta + | source """ self.single_line_template_tags: str = r"""