fixed settings, added docs note

This commit is contained in:
Christopher Pickering 2022-01-03 08:45:38 -06:00
parent 97967dc622
commit c7d73bed09
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
3 changed files with 7 additions and 5 deletions

View file

@ -50,15 +50,15 @@ Usage:
custom_blocks = "toc,example"
custom_html
-------------
-----------
Use to indent custom HTML tags. For example ``<mjml>`` or ``<simple-greeting>``
Use to indent custom HTML tags. For example ``<mjml>`` or ``<simple-greeting>`` or ``<mj-\w+>``
Usage:
.. code:: ini
custom_html = "mjml,simple-greeting"
custom_html = "mjml,simple-greeting,mj-\\w+"
indent
------

View file

@ -777,6 +777,7 @@ class Config:
| summary
| """
+ self.always_self_closing_html_tags
+ self.custom_html
+ """
"""
)

View file

@ -7,7 +7,7 @@ run::
for a single test, run::
pytest tests/test_config.py::test_indent --cov=src/djlint \
pytest tests/test_config.py::test_custom_html --cov=src/djlint \
--cov-branch --cov-report xml:coverage.xml --cov-report term-missing
"""
@ -33,9 +33,10 @@ def test_custom_tags(runner: CliRunner) -> None:
)
assert result.exit_code == 1
def test_custom_html(runner: CliRunner) -> None:
result = runner.invoke(djlint, ["tests/config_custom_html/html.html", "--check"])
print(result.output)
assert (
"""-<mjml><mj-body>this is a email text</mj-body></mjml>
+<mjml>