Improve pseudo-class error message #270
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When encountering a pseudo-class that is unrecognized, we should not state it is "unsupported" a it may be entirely invalid. While there are some pseudo-classes that are valid but not supported, the status of such things can change all the time and our internal list may become outdated.
Additionally, sometimes users trying to incorrectly specify tags with namespaces can trigger this message as they may assume that because a namespace is declared in their document as
ns:element
that they can do this in CSS as well. This specific case is not easily detectable for us as we generically parse the syntax, not the intent of the syntax.To clear up confusion, be more specific and simply state that anytime a pseudo-class is not recognized by soupsieve that it is either invalid or not recognizable by soupsieve. By stating both possibilities, this points out that pseudo-class syntax was noted and that it is unrecognized by soupsieve, regardless of status, and may be entirely invalid. Additionally, note that if it being recognized as a pseudo-class is a surprise that the colon can be escaped to avoid the recognition as such.