Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ofeige committed Jan 13, 2025
1 parent f825dcf commit 9a48463
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Readability.php
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ private function hasSingleTagInsideElement(\DOMElement $node, string $tag): bool
$childNodes = iterator_to_array($node->childNodes);
$children = array_filter($childNodes, fn ($childNode) => $childNode instanceof \DOMElement);

$children = array_values($children);
// There should be exactly 1 element child with given tag
if (1 !== \count($children) || $children[0]->nodeName !== $tag) {
return false;
Expand Down

0 comments on commit 9a48463

Please sign in to comment.