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
<html><body>
<div \
>
div with syntax error in start tag
<div>nested div</div>
</div>
</body></html>
is parsed with content type text/html, the parser correctly recognizes the malformed div start tag and calls visit on chameleon.parser.ElementParser with kind error. This looks for visit_error and because this is undefined uses vist_default instead -- which turns the bad start tag into a text node. As a consequence, the start/end tag structure is broken and an error is reported (potentially much) later regarding a mismatch end tag.
ElementParser should define visit_error and ensure that the error is reported immediately.
The text was updated successfully, but these errors were encountered:
I suppose in this case it's a bit of a grey area :-)
I have spent hours to understand what happened in a concrete (complex) case:
in this case, I got a parser error "mismatched closing tag"
far below the buggy open tag (and not refering to it).
Just ignoring an open tag containing some type of bugs is not
helpful for locating the problem.
This is a reformulation of zopefoundation/Zope#710.
When the template
is parsed with content type
text/html
, the parser correctly recognizes the malformeddiv
start tag and callsvisit
onchameleon.parser.ElementParser
with kinderror
. This looks forvisit_error
and because this is undefined usesvist_default
instead -- which turns the bad start tag into a text node. As a consequence, the start/end tag structure is broken and an error is reported (potentially much) later regarding a mismatch end tag.ElementParser
should definevisit_error
and ensure that the error is reported immediately.The text was updated successfully, but these errors were encountered: