We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2f10cc commit 9918437Copy full SHA for 9918437
src/Translator.php
@@ -29,17 +29,14 @@ public function __toString():string {
29
}
30
31
public function asXPath():string {
32
- $cssParts = explode(",", $this->cssSelector);
33
- $xpathParts = [];
34
- foreach($cssParts as $part) {
35
- $xpathParts []= $this->convert($part);
36
- }
37
-
38
- return implode(" | ", $xpathParts);
+ return $this->convert($this->cssSelector);
39
40
41
protected function convert(string $css):string {
42
- $cssArray = explode(",", $css);
+ $cssArray = preg_split(
+ '/(["\']).*?\1(*SKIP)(*F)|,/',
+ $css
+ );
43
$xPathArray = [];
44
45
foreach($cssArray as $input) {
0 commit comments