-
-
Notifications
You must be signed in to change notification settings - Fork 469
Closed
Labels
Description
Firstly, let me say thanks for maintaining such a great library, it has been exceptionally useful in my project. But on to the issue
Using the following code:
$dom->find('div > ul');Results in an empty set, despite the html being valid. It seems the find() function does not support child selectors. I added in a unit test to SelectorTest.php to confirm the results.
The test code:
public function testFindClassWithChildSelector() {
$root = new HtmlNode(new Tag('root'));
$parent = new HtmlNode(new Tag('div'));
$child1 = new HtmlNode(new Tag('ul'));
$root->addChild($parent);
$parent->addChild($child1);
$selector = new Selector('div > ul');
$this->assertEquals(1, count($selector->find($root)));
}I'm going to see if I can't add the functionality myself. However, given your familiarity with the library you may be able to make a quick change to fix this.
