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

Some syntax errors are badly handled #298

Open
d-maurer opened this issue Oct 22, 2019 · 3 comments
Open

Some syntax errors are badly handled #298

d-maurer opened this issue Oct 22, 2019 · 3 comments
Labels

Comments

@d-maurer
Copy link

This is a reformulation of zopefoundation/Zope#710.

When the template

<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.

@dataflake
Copy link
Collaborator

@malthe Shouldn't this be marked as a bug and not a feature?

@malthe
Copy link
Owner

malthe commented Jul 15, 2020

I suppose in this case it's a bit of a grey area :-)

@d-maurer
Copy link
Author

d-maurer commented Jul 15, 2020 via email

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

No branches or pull requests

3 participants