mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-16 09:03:09 +00:00
[pre-commit] Running pre-commit
This commit is contained in:
parent
3692a9bf2e
commit
97967dc622
2 changed files with 7 additions and 2 deletions
|
|
@ -136,12 +136,14 @@ def build_custom_blocks(custom_blocks: Union[str, None]) -> Optional[str]:
|
|||
return "|" + "|".join(x.strip() for x in custom_blocks.split(","))
|
||||
return None
|
||||
|
||||
|
||||
def build_custom_html(custom_html: Union[str, None]) -> Optional[str]:
|
||||
"""Build regex string for custom HTML blocks."""
|
||||
if custom_html:
|
||||
return "|" + "|".join(x.strip() for x in custom_html.split(","))
|
||||
return None
|
||||
|
||||
|
||||
class Config:
|
||||
"""Djlint Config."""
|
||||
|
||||
|
|
@ -185,7 +187,7 @@ class Config:
|
|||
self.custom_blocks: str = str(
|
||||
build_custom_blocks(djlint_settings.get("custom_blocks")) or ""
|
||||
)
|
||||
|
||||
|
||||
self.custom_html: str = str(
|
||||
build_custom_html(djlint_settings.get("custom_html")) or ""
|
||||
)
|
||||
|
|
@ -446,7 +448,7 @@ class Config:
|
|||
| var
|
||||
| video
|
||||
| wbr
|
||||
"""
|
||||
"""
|
||||
+ self.custom_html
|
||||
)
|
||||
|
||||
|
|
|
|||
3
tests/config_custom_html/pyproject.toml
Normal file
3
tests/config_custom_html/pyproject.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[tool]
|
||||
[tool.djlint]
|
||||
custom_html = "mjml,mj-body"
|
||||
Loading…
Reference in a new issue