-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
This is a bug report for https://github.com/symfony/css-selector
Given a CSS selector #abc\.def
that matches an element <div id="abc.def">
the resulting XPath selector contains [@id = '#abc\.def']
, but the backslash should be omitted for the XPath. The XPath converter should unescape CSS selector parts, this holds for ID's, classes and element names.
EDIT: it does seem to unescape hex sequences (\34 5
=> 45
) but not other special characters such as .
and :
Test code:
$xpath = (new CssSelectorConverter())->toXPath('#abc\.def');
// descendant-or-self::*[@id = 'abc\.def']