Skip to content

children() not working correctly #112

@technosophos

Description

@technosophos

Children's filter processing is working incorrectly:

<?php
//define('QP_NO_AUTOLOADER', TRUE);
require 'src/qp.php';

$html = '<html><body><div id="hello"><p>One</p><p>TWO</p><div><p>test</p></div></div></body></html>';
$qp = htmlqp($html, '#hello');

print "Number of #hello elements: " . count($qp) . PHP_EOL;
print "Number of P children should be 2: " . $qp->children('div>p')->count() . PHP_EOL;
print "Number of div>P children should be 1: " . $qp->children('div>p')->count() . PHP_EOL;
exit;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions