-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [Formatter] Nunjucks block assignment changes in v1.28 incorrect #670
Comments
After think a little more about it, I still think the the right answer is to not format the contents of block There could obviously be cases where it doesn't matter, like the original
That doesn't necessarily resolve the |
Thanks, I'll get this fixed in the next release. The New change: {% for tag in collections.all | getAllTags | filterTagList | sort %}
{% set tagUrl %}
- /tags/{{ tag | slugify }}/{% endset %}
- <a href="{{ tagUrl }}" class="post-tag">[{{ tag }} ({{ collections[tag].length }}](https://github.com/Riverside-Healthcare/djLint/issues/%7B%7B%20tagUrl%20%7D%7D)[)](https://github.com/Riverside-Healthcare/djLint/issues/%7B%7B%20tagUrl%20%7D%7D)</a>
- {% endfor %}
+ /tags/{{ tag | slugify }}/
+ {% endset %}
+ <a href="{{ tagUrl }}" class="post-tag">[{{ tag }} ({{ collections[tag].length }})](https://github.com/Riverside-Healthcare/djLint/issues/%7B%7B%20tagUrl%20%7D%7D)</a>
+{% endfor %} If at some point you want to prevent set from being indented you could add it to the |
# [1.30.0](v1.29.0...v1.30.0) (2023-05-30) ### Bug Fixes * **formatter:** fixed endset indent level ([cdebe42](cdebe42)), closes [#670](#670) * **formatter:** fixed issue with spaceless macro tags having spacess added before - ([5593937](5593937)), closes [#667](#667) * **npm:** install exact version of djlint ([0727279](0727279)) ### Features * **npm:** add script to update djlint version in postinstall using semantic-release/exec ([040ffc6](040ffc6))
🎉 This issue has been resolved in version 1.30.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
System Info
python --version
): 3.10.11djlint --version
): 1.29.0Issue
Nunjucks block assignment changes from #646 in v1.28, with fixes in v1.29, are incorrect.
Give the following code as formatted in v1.27.2:
the formatting with v1.28/v1.29 is
This has two issues
{% endset %}
isn't carried to the next line with the appropriate indent, so the following lines all have the incorrect indent.set
s like this introduces undesirable whitespace, that then has to be trimmed. It be really helpful if there were an option to disable this behavior (without disabling everything). I didn't see one in configuration.How To Reproduce
For reference my
.djlintrc
isThe text was updated successfully, but these errors were encountered: