Merge pull request #452 from Riverside-Healthcare/dev

This commit is contained in:
sur.la.route 2022-11-08 01:44:48 -06:00 committed by GitHub
commit 4387ba57c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View file

@ -37,7 +37,7 @@ def format_css(html: str, config: Config) -> str:
line = line.lstrip()
ignore_indent = False
if ignore_indent is False:
if ignore_indent is False and line:
beautified += "\n" + inner_indent + line
else:

View file

@ -38,9 +38,9 @@ def format_js(html: str, config: Config) -> str:
line = line.lstrip()
ignore_indent = False
if ignore_indent is False:
if ignore_indent is False and line:
beautified += "\n" + inner_indent + line
else:
beautified += "\n" + line

View file

@ -0,0 +1,14 @@
<html>
<head>
<style>
body {}
div {}
</style>
</head>
<script>
let a;
let b;
</script>
</html>

View file

@ -35,3 +35,14 @@ def test_ignore(runner: CliRunner) -> None:
],
)
assert result.exit_code == 0
def text_blank_lines(runner: CliRunner) -> None:
result = runner.invoke(
djlint,
[
"tests/test_config/test_scripts_styles/blank_lines.html",
"--check",
],
)
assert result.exit_code == 0