Skip to content

remove() doesn't work on root elements in an html part #25

@Defcon0

Description

@Defcon0

When doing the following, the div isn't removed from the html:

$objNode        = new HtmlPageCrawler('<div class="test"><p>Hallo</p></div>');
$objNode->filter('.test')->remove();

$x = $objNode->saveHTML();

When doing $objNode->filter('p')->remove(); the p-elements are correctly removed. Also when wrapping the div in another div it also works.

So it seems that I cannot remove root elements, can I? At least a hint in the comment would've been nice ;-) Maybe the bug can be fixed.

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