mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-05 20:34:42 +00:00
closes #175, added test
This commit is contained in:
parent
244f20b88c
commit
b79449c386
4 changed files with 16 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ keywords: template linter, template formatter, djLint, HTML, templates, formatte
|
|||
::: content
|
||||
|
||||
- Bug fixes [#187](https://github.com/Riverside-Healthcare/djLint/issues/187)
|
||||
- Added better support for ``yaml`` front matter in template files
|
||||
:::
|
||||
|
||||
## 0.7.4
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ keywords: облицовка шаблонов, форматер шаблонов
|
|||
::: content
|
||||
|
||||
- Исправления ошибок [#187](https://github.com/Riverside-Healthcare/djLint/issues/187)
|
||||
- Добавлена улучшенная поддержка ``yaml`` front matter в файлах шаблонов
|
||||
:::
|
||||
|
||||
## 0.7.4
|
||||
|
|
|
|||
|
|
@ -687,6 +687,7 @@ class Config:
|
|||
| {%[ ]*?blocktranslate\b[^(?:%})]*?%}.*?{%[ ]*?endblocktranslate[ ]*?%}
|
||||
| {%[ ]*?blocktrans\b[^(?:%})]*?%}.*?{%[ ]*?endblocktrans[ ]*?%}
|
||||
| {%[ ]*?comment\b[^(?:%})]*?%}.*?(?={%[ ]*?endcomment[ ]*?%})
|
||||
| ^---[\s\S]+?---
|
||||
"""
|
||||
|
||||
self.ignored_inline_blocks: str = r"""
|
||||
|
|
|
|||
|
|
@ -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_pre_tag --cov=src/djlint --cov-branch \
|
||||
pytest tests/test_html.py::test_front_matter --cov=src/djlint --cov-branch \
|
||||
--cov-report xml:coverage.xml --cov-report term-missing
|
||||
|
||||
|
||||
|
|
@ -21,6 +21,18 @@ from src.djlint import main as djlint
|
|||
from .conftest import reformat, write_to_file
|
||||
|
||||
|
||||
def test_front_matter(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
output = reformat(
|
||||
tmp_file,
|
||||
runner,
|
||||
b"""---
|
||||
layout: <div><div></div></div>
|
||||
---
|
||||
<div></div>""",
|
||||
)
|
||||
assert output.exit_code == 0
|
||||
|
||||
|
||||
def test_pre_tag(runner: CliRunner, tmp_file: TextIO) -> None:
|
||||
# added for https://github.com/Riverside-Healthcare/djLint/issues/187
|
||||
output = reformat(
|
||||
|
|
|
|||
Loading…
Reference in a new issue