Merge pull request #299 from Riverside-Healthcare/dev

This commit is contained in:
sur.la.route 2022-07-25 08:09:19 -05:00 committed by GitHub
commit 7aa6d4a5ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 15 deletions

View file

@ -1,12 +1,12 @@
{
"name": "djlint_docs",
"version": "1.0.19",
"version": "1.0.20",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "djlint_docs",
"version": "1.0.19",
"version": "1.0.20",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@creativebulma/bulma-divider": "^1.1.0",
@ -25,7 +25,7 @@
"@11ty/eleventy-img": "2.0.0",
"@11ty/eleventy-plugin-syntaxhighlight": "4.0.0",
"@fontsource/inter": "4.5.7",
"@fortawesome/fontawesome-free": "^6.1.1",
"@fortawesome/fontawesome-free": "6.1.1",
"@fullhuman/postcss-purgecss": "4.1.3",
"@toycode/markdown-it-class": "1.2.4",
"algoliasearch": "4.13.0",

View file

@ -1,6 +1,6 @@
{
"name": "djlint_docs",
"version": "1.0.19",
"version": "1.0.20",
"description": "",
"main": "index.js",
"scripts": {
@ -29,7 +29,7 @@
"@11ty/eleventy-img": "2.0.0",
"@11ty/eleventy-plugin-syntaxhighlight": "4.0.0",
"@fontsource/inter": "4.5.7",
"@fortawesome/fontawesome-free": "^6.1.1",
"@fortawesome/fontawesome-free": "6.1.1",
"@fullhuman/postcss-purgecss": "4.1.3",
"@toycode/markdown-it-class": "1.2.4",
"algoliasearch": "4.13.0",

16
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "djlint",
"version": "1.4.0",
"version": "1.7.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "djlint",
"version": "1.4.0",
"version": "1.7.0",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"dependencies": {
@ -10310,9 +10310,9 @@
}
},
"node_modules/terser": {
"version": "5.14.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz",
"integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==",
"version": "5.14.2",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
"integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"dev": true,
"peer": true,
"dependencies": {
@ -19885,9 +19885,9 @@
}
},
"terser": {
"version": "5.14.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz",
"integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==",
"version": "5.14.2",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
"integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"dev": true,
"peer": true,
"requires": {

View file

@ -94,7 +94,7 @@ def condense_html(html: str, config: Config) -> str:
for tag in [x.strip() for x in config.blank_line_after_tag.split(",")]:
html = re.sub(
re.compile(
rf"((?:{{%\s*?{tag}\b[^}}]+?%}}\n?)+)",
rf"((?:{{%\s*?{tag}\b[^}}]+?%}}\n?)+)(?=[^\n])",
re.IGNORECASE | re.MULTILINE | re.DOTALL,
),
func,

View file

@ -0,0 +1,3 @@
{% extends nothing %}
<div></div>

View file

@ -2,7 +2,7 @@
run::
pytest tests/test_config.py --cov=src/djlint --cov-branch \
pytest tests/test_config/test_blank_lines_after_tag/test_config.py --cov=src/djlint --cov-branch \
--cov-report xml:coverage.xml --cov-report term-missing
for a single test, run::
@ -94,3 +94,14 @@ def test_blank_lines_after_tag(runner: CliRunner) -> None:
["tests/test_config/test_blank_lines_after_tag/html_seven.html", "--check"],
)
assert result.exit_code == 0
# check that multiple blank lines are not added
result = runner.invoke(
djlint,
[
"tests/test_config/test_blank_lines_after_tag/html_eight.html",
"--preserve-blank-lines",
"--check",
],
)
assert result.exit_code == 0