-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
:valid and :invalid support #34
Comments
Some thoughts on this, and why I've added the In general, there is a lot of work to do here, but none of it is impossible, but some is an excessive amount of work. Things like validating emails is easy. Validating URLs is a bit more, validating patterns is a ton. Why is validating patterns a ton of work? Well, HTML basically uses the JavaScript regular expression engine to evaluate the patterns. We use Python. Python Re != JavaScript Regexp. JavaScript adds So how do you get over this hurdle?
Anyways, it's a lot of work. Some validation (like the work done for |
JavaScript does allow look behinds. It didn't used to, but now it does in some browsers. If this was going to be done with Python, it would have to be done with the |
After doing some work to address a bug in Soup Sieve doesn't control such things, this is all handled by the Beautiful Soup and the parsers. By time Soup Sieve gets to look at the content in an input, it is has already had entities turned into Unicode characters and other characters normalized ( In some implementations, we may just have to accept we that we can only approximate how some selectors work based on the limitations of the environment. |
Support for this would require quite a bit of work. We would need to write proper validators for each kind of input type. I am not sure when this will get done, but it is large enough to be a case unto itself.
This would includeMoved to a separate issue.:in-range
and:out-of-range
, though as:in-range
and:out-of-range
is more simple, it is possible that could get implemented first.The text was updated successfully, but these errors were encountered: