mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-15 16:43:12 +00:00
fixed #177, added test
This commit is contained in:
parent
d596abe121
commit
3e0b13edcb
5 changed files with 22 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>"]
|
||||
|
|
|
|||
|
|
@ -754,7 +754,7 @@ class Config:
|
|||
| head
|
||||
| body
|
||||
| div
|
||||
| a
|
||||
# | a # a gets no breaks #177
|
||||
| nav
|
||||
| ul
|
||||
| ol
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue