extend docs with custom_html section, add test_custom_html, add test fixture

This commit is contained in:
TK 2021-12-30 19:40:37 +01:00
parent 3f27f6c88c
commit 3692a9bf2e
3 changed files with 27 additions and 0 deletions

View file

@ -49,6 +49,17 @@ Usage:
custom_blocks = "toc,example"
custom_html
-------------
Use to indent custom HTML tags. For example ``<mjml>`` or ``<simple-greeting>``
Usage:
.. code:: ini
custom_html = "mjml,simple-greeting"
indent
------

View file

@ -0,0 +1 @@
<mjml><mj-body>this is a email text</mj-body></mjml>

View file

@ -33,6 +33,21 @@ 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"])
assert (
"""-<mjml><mj-body>this is a email text</mj-body></mjml>
+<mjml>
+ <mj-body>
+ this is a email text
+ </mj-body>
+</mjml>
"""
in result.output
)
assert result.exit_code == 1
def test_extension(runner: CliRunner) -> None:
result = runner.invoke(djlint, ["tests/config_extension", "--check"])