dart-lang / html

Dart port of html5lib. For parsing HTML/HTML5 with Dart. Works in the client and on the server.
https://pub.dev/packages/html
Other
276 stars 58 forks source link

Don't throw on not-matching elements in visitPseudoClassSelector #229

Open TheCarpetMerchant opened 11 months ago

TheCarpetMerchant commented 11 months ago

This is for #223. I personally do not wish to have an exception thrown because of a simple typo in an html selector, that seems wildly excessive. The selector wouldn't be able to be used anyway. While silently ignoring errors is not great, in this case it is the better option for me in practice. This PR is here moreso to raise awareness on the issue then anything else ; ideas on how to handle this by giving more leverage over the matching process to devs are welcome.