diff --git a/src/Translator.php b/src/Translator.php index c785594..a0a9479 100644 --- a/src/Translator.php +++ b/src/Translator.php @@ -67,7 +67,11 @@ protected function convertSingleSelector(string $css):string { switch ($currentThreadItem["type"]) { case "star": case "element": - $xpath []= $currentThreadItem['content']; + if($this->htmlMode) { + $xpath []= strtolower($currentThreadItem['content']); + } else { + $xpath []= $currentThreadItem['content']; + } $hasElement = true; break; diff --git a/test/phpunit/TranslatorTest.php b/test/phpunit/TranslatorTest.php index cc4a6ec..2996ac9 100644 --- a/test/phpunit/TranslatorTest.php +++ b/test/phpunit/TranslatorTest.php @@ -211,6 +211,14 @@ public function testCaseSensitivityHtmlMode() { 0, $xpath->query($attributeValueCaseSensitive)->length ); + + $tagNameCaseInsensitive = new Translator( + "dIv" + ); + self::assertEquals( + 1, + $xpath->query($tagNameCaseInsensitive)->length + ); }