-
Notifications
You must be signed in to change notification settings - Fork 195
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
Kuchiki tests should use strict mode #963
Comments
Happy to do some work on this, I’ll probably reach out for some initial help getting started though. |
Hmm, I don't remember what I was thinking of when I wrote this. @Nemo157 mentioned it originally - do you know where the kuchiki setting for this is? I do see https://docs.rs/kuchiki/0.8.1/kuchiki/struct.ParseOpts.html#structfield.on_parse_error, maybe we could set it to panic if it sees an error? |
I think it's probably |
No, that just reports more detailed errors, it doesn't change the behavior: https://docs.rs/html5ever/0.25.1/src/html5ever/tree_builder/mod.rs.html#474 |
Sounds like it reports all the errors it encounters instead of being a browser and allowing malformed html to be silently accepted |
TBH when suggesting that I had no idea whether kuchiki had such an option, it just seemed like something it would likely support. |
So we want to panic on error? Or does this need to be closed. Looking through the kuchiki docs, couldn’t anything about a “strict” mode. |
Let's start by panicking on error and if that has too many false positives we can reconsider. The issues in #957 (comment) were pretty blatant, I'd be surprised if we couldn't find some way to catch that in kuchiki. |
So threw together something quick for initial testing, every parse I've tried seems to fail with "unexpected token", below being one example
and
New to rust and not too familiar with html5ever, but should we allow "unexpected token" and only panic on other errors? Or let me know if something seems wrong in general. |
This might be because we have |
Alright, sounds good. I'll wait until it lands. |
This would have caught the issues in #957 (comment) automatically.
The text was updated successfully, but these errors were encountered: