We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
OS: Arch Linux
Python Version (python --version): 3.12.7
python --version
djLint Version (djlint --version): djlint, version 1.36.1
djlint --version
template language: e.g. mustache: jinja2
Djlint replaces kwargs with empty {} inside macro definitions.
kwargs
{}
Here's a sample from our source code:
{% macro _expand_attrs(attrs) %} {% for attr, val in attrs.items() -%}{{ attr }}="{{ val }}"{% endfor %} {% endmacro %} {% macro button(text, _tag="button", class="") %} <{{- _tag }} class="p-[10px] bg-[#FF7A00] rounded-[8px] text-white transition duration-150 transition-color disabled:opacity-50 {{class}}" {{ _expand_attrs(kwargs) }}> {% if caller is defined %} {{ caller() }} {% else %} {{ text }} {% endif %} </{{- _tag -}}> {% endmacro %} {% macro link_button(text, href='') %} {{ button(text, type="link", _="on click go to url '"~href~"'", **kwargs) }} {% endmacro %}
Upoon formatting with djlint, it replaces kwargs uses with {}
djlint
The text was updated successfully, but these errors were encountered:
Using the online djlint formatter, I can't reproduce the issue.
Which "kwarg" do you mean? Both "kwargs"?
Do you have any other settings?
Sorry, something went wrong.
Hey there, thanks for the fast response :)
I meant every kwargs use was replaced with an empty dict. Both in link_button and in button.
link_button
button
I haven't tried the web formatter, but it is occourring in the CLI. I'm not sure if this is relevant, but my file extension is .html.j2.
.html.j2
No branches or pull requests
System Info
OS: Arch Linux
Python Version (
python --version
): 3.12.7djLint Version (
djlint --version
): djlint, version 1.36.1template language: e.g. mustache: jinja2
Issue
Djlint replaces
kwargs
with empty{}
inside macro definitions.How To Reproduce
Here's a sample from our source code:
Upoon formatting with
djlint
, it replaceskwargs
uses with{}
The text was updated successfully, but these errors were encountered: