mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-10 22:53:09 +00:00
extend docs with custom_html section, add test_custom_html, add test fixture
This commit is contained in:
parent
3f27f6c88c
commit
3692a9bf2e
3 changed files with 27 additions and 0 deletions
|
|
@ -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
|
||||
------
|
||||
|
||||
|
|
|
|||
1
tests/config_custom_html/html.html
Normal file
1
tests/config_custom_html/html.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<mjml><mj-body>this is a email text</mj-body></mjml>
|
||||
|
|
@ -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"])
|
||||
|
|
|
|||
Loading…
Reference in a new issue