You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some combination of html attributes and escaped quotes will break the html during djlint's indenting step.
As a note: I hate using json strings in html attributes like this, but it's valid syntax and some libraries just require this.
Also, it would be nice to have a feature to actually not format inside html attributes at all, like e.g. this issue #723 mentions, or format json properly.
The underlying issue is that escaped quotes are not properly ignored, so djlint doesn't match all the html attributes of a tag if it intends to do so.
There is actually another "hidden" issue that once I made djlint respect escaped quotes, I saw that the quotes in template tags are not cleanly handled in the matching of the html attributes. Since this only shows if I fixed the above, I just fixed both in one go (see the PR linked below).
How To Reproduce
Here is a test, see my PR I will link create in the next minutes.
System Info
Issue
Some combination of html attributes and escaped quotes will break the html during djlint's indenting step.
As a note: I hate using json strings in html attributes like this, but it's valid syntax and some libraries just require this.
Also, it would be nice to have a feature to actually not format inside html attributes at all, like e.g. this issue #723 mentions, or format json properly.
Example
Using
max_attribute_length=1
and formattingwill result in
(note that this removes some characters!)
instead of
The underlying issue is that escaped quotes are not properly ignored, so djlint doesn't match all the html attributes of a tag if it intends to do so.
There is actually another "hidden" issue that once I made djlint respect escaped quotes, I saw that the quotes in template tags are not cleanly handled in the matching of the html attributes. Since this only shows if I fixed the above, I just fixed both in one go (see the PR linked below).
How To Reproduce
Here is a test, see my PR I will link create in the next minutes.
The text was updated successfully, but these errors were encountered: