mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-12 10:00:57 +00:00
fixed #118, added test
This commit is contained in:
parent
00ed6b18d2
commit
7d4e4920bc
2 changed files with 14 additions and 3 deletions
|
|
@ -29,7 +29,6 @@ def indent_html(rawcode: str, config: Config) -> str:
|
|||
slt_template = config.optional_single_line_template_tags
|
||||
|
||||
for item in rawcode_flat_list:
|
||||
|
||||
# if a raw tag first line
|
||||
if not is_block_raw and is_ignored_block_opening(config, item):
|
||||
is_raw_first_line = True
|
||||
|
|
@ -80,7 +79,6 @@ def indent_html(rawcode: str, config: Config) -> str:
|
|||
re.IGNORECASE | re.MULTILINE | re.VERBOSE,
|
||||
)
|
||||
and is_block_raw is False
|
||||
or re.search(config.ignored_block_closing, item, re.IGNORECASE | re.VERBOSE)
|
||||
):
|
||||
indent_level = max(indent_level - 1, 0)
|
||||
tmp = (indent * indent_level) + item + "\n"
|
||||
|
|
|
|||
|
|
@ -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_ignored_attributes --cov=src/djlint --cov-branch \
|
||||
pytest tests/test_html.py::test_textarea_tag --cov=src/djlint --cov-branch \
|
||||
--cov-report xml:coverage.xml --cov-report term-missing
|
||||
|
||||
|
||||
|
|
@ -33,6 +33,19 @@ asdf
|
|||
</div>
|
||||
"""
|
||||
)
|
||||
# check double nesting
|
||||
output = reformat(
|
||||
tmp_file,
|
||||
runner,
|
||||
b"""<div>
|
||||
<div class="field">
|
||||
<textarea>asdf</textarea>
|
||||
</div>
|
||||
</div>
|
||||
""",
|
||||
)
|
||||
|
||||
assert output["exit_code"] == 0
|
||||
|
||||
|
||||
def test_script_tag(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue