fixed #177, added test

This commit is contained in:
Christopher Pickering 2022-01-31 16:16:17 -06:00
parent d596abe121
commit 3e0b13edcb
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
5 changed files with 22 additions and 6 deletions

View file

@ -8,6 +8,12 @@ keywords: template linter, template formatter, djLint, HTML, templates, formatte
# Changelog
## 0.7.4
::: content
- Bug fixes [#177](https://github.com/Riverside-Healthcare/djLint/issues/177)
:::
## 0.7.3
::: content

View file

@ -7,7 +7,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name="djlint"
version="0.7.3"
version="0.7.4"
description="HTML Template Linter and Formatter"
license="GPL-3.0-or-later"
authors=["Christopher Pickering <cpickering@rhc.net>"]

View file

@ -754,7 +754,7 @@ class Config:
| head
| body
| div
| a
# | a # a gets no breaks #177
| nav
| ul
| ol

View file

@ -76,9 +76,7 @@ def test_without_config(runner: CliRunner, tmp_file: TextIO) -> None:
== r"""<a class="asdf {% if favorite == "yes" %}favorite{% endif %} has-tooltip-arrow has-tooltip-right"
data-tooltip="{% if favorite == "yes" %}Remove from Favorites {% else %}Add to Favorites{% endif %}"
fav-type="report"
object-id="{{ report.report_id }}">
<span class="icon has-text-grey is-large "><i class="fas fa-lg fa-star"></i></span>
</a>
object-id="{{ report.report_id }}"><span class="icon has-text-grey is-large "><i class="fas fa-lg fa-star"></i></span></a>
"""
)
output = reformat(

View file

@ -5,7 +5,7 @@ run::
pytest tests/test_html.py --cov=src/djlint --cov-branch \
--cov-report xml:coverage.xml --cov-report term-missing
pytest tests/test_html.py::test_script_tag --cov=src/djlint --cov-branch \
pytest tests/test_html.py::test_a_tag --cov=src/djlint --cov-branch \
--cov-report xml:coverage.xml --cov-report term-missing
@ -71,6 +71,18 @@ asdf
)
def test_a_tag(runner: CliRunner, tmp_file: TextIO) -> None:
output = reformat(
tmp_file,
runner,
b"""<p>
some nice text <a href="this">asdf</a>, ok
</p>""",
)
assert output.exit_code == 0
def test_script_tag(runner: CliRunner, tmp_file: TextIO) -> None:
write_to_file(
tmp_file.name,