Skip to content

Can't find a node that matches selector if it's parent matches selector #103

@maxstar

Description

@maxstar
<parent attribute="something">
    <child attribute="anything"></child>
</parent>

$dom->find('[attribute]') returns only parent node.
In Selector.php

               if ($pass) {
                    // it passed all checks
                    $return[] = $child;
                } else {
                    // this child failed to be matched
                    if ($child instanceof InnerNode &&
                        $child->hasChildren()
                    ) {
                        // we still want to check its children
                        $children[] = $child;
                    }
                }

'else' block must be executed regardless of whether the current node has passed the match or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions