diff options
author | Andres Rey <[email protected]> | 2017-11-11 21:14:47 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-11 21:14:47 +0000 |
commit | 78abbeb6f6446cc6fde87d62499d03bb26941f7d (patch) | |
tree | 1f8b709346097de111f3768ec241bb234f00b9cf /src/HTMLParser.php | |
parent | 24aeb34aa6724675e3a501d29258f20ea2d18d67 (diff) |
Filter empty children nodes when scanning for single P nodes
Diffstat (limited to 'src/HTMLParser.php')
-rw-r--r-- | src/HTMLParser.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index b896ef7..cea379c 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -1486,7 +1486,7 @@ class HTMLParser private function hasSinglePNode(Readability $node) { // There should be exactly 1 element child which is a P: - if (count($children = $node->getChildren()) !== 1 || !$children[0]->tagNameEqualsTo('p')) { + if (count($children = $node->getChildren(true)) !== 1 || !$children[0]->tagNameEqualsTo('p')) { return false; } |