cssselect
cssselect copied to clipboard
Colon in attribute
In CSS, it turns out you can specify a colon in an attribute name by escaping it.
This is not valid:
::attr(:foo)
But this is:
::attr(\:foo)
And cssselect
fails on the former and supports the later, as it should, only that it fails to translate it into a valid XPath expression. It turns it into:
descendant-or-self::*/@:foo
I’m not sure what the best XPath translation would be (this?), but the current one seem to be invalid XPath.