Closed michael-yin closed 2 years ago
I thought it was illegal to use unencoded <
and >
characters inside HTML attributes, but I could only find this paragraph about it in the (outdated) HTML 4 standard:
authors should use "\>" (ASCII decimal 62) in text instead of ">" to avoid problems with older user agents that incorrectly perceive this as the end of a tag (tag close delimiter) when it appears in quoted attribute values.
So I guess until this bug is fixed DjHTML should be considered an "older user agent" :-)
Similar problems here, using alpine if and things like x-if="currentStep > step.number"
Past behaviour was different - I narrowed the change down to between 1.4.12 and 1.4.13.
I checked djhtml
source code and it seems not easy to solve this problem in elegant way.
So here is my solution:
UUID
, and store the real value in a dict
>
in the attribute will not be process by djhtml
djhtml
process the HTML, we detect some special attributes and replace the UUID
with the orignal value.I already make it work in my Stimulus project and here is the commit https://github.com/michael-yin/djhtml/commit/90d5ddfba78a059c4c238034767f3dc0113f88d2
Maybe we can add attribute ignore list
to djhtml
and let it ignore value in the attributes.
Thx.
@michael-yin I appreciate your solution, but I think we have found an even better solution that also fixes this bug. Could you verify that the latest release solves your problem?
If we have a simple
test.html
fileIf I run
djhtml -i test.html
I got
As you can see, the last
</div>
indention is not correct.The
click->modal#closeBackground
caused this problem.