Closed fireproofsocks closed 2 years ago
I've created a pull request implementing this feature.
The "i" flag is now detected by the lexer if it's preceded by a space and followed by a ]
in the attribute selector definition.
If the "i" flag is detected, the attribute selector will be case-insensitive.
The "s" flag is also detected, but will do the default case-sensitive matching.
I've also added tests for all match operators.
It would be nice if it were possible to do case-insensitive CSS selection.
For example, given some HTML like the following :
the following
find
operation would fail:whereas the following
find
operation would succeed:An implementation of case-insensitive selectors would allow the
i
flag:and this would match any variant of the
ROBOTS
capitalization.For some discussion on case-insensitive CSS selectors: https://css-tricks.com/attribute-selectors/