Skip to content
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

formatting error with chameleon expression as attribute #171

Open
thet opened this issue Jun 16, 2024 · 0 comments
Open

formatting error with chameleon expression as attribute #171

thet opened this issue Jun 16, 2024 · 0 comments

Comments

@thet
Copy link
Member

thet commented Jun 16, 2024

this:

<input class="form-check-input" type="checkbox" value="" name="enabled" ${python:"checked" if bundle["enabled"] else ''} />

is changed to:

                      <input class="form-check-input"
                             ${python:"checked"=""
                             ''}=""
                             bundle["enabled"]=""
                             else=""
                             if=""
                             name="enabled"
                             type="checkbox"
                             value=""
                      />

It does format correctly for full HTML attributes with a key and value like this:

                      <input class="form-check-input"
                             checked="${python:'checked' if bundle['enabled'] else None}"
                             name="enabled"
                             type="checkbox"
                             value=""
                      />

zpretty version: 3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant