diff options
author | Andres Rey <[email protected]> | 2017-11-28 21:01:34 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-28 21:01:34 +0000 |
commit | 1c3309958978283a7868e81d99cc7381ac30ed94 (patch) | |
tree | f5e7d82e7fa73f6b6d8aef61711cc756d478e73f | |
parent | 883c9029aba45ef2351296490d4cc91725f6c2ba (diff) |
But don't forget to replace the current node
-rw-r--r-- | src/Readability.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Readability.php b/src/Readability.php index 4e0d4a1..aca5e21 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -477,7 +477,8 @@ class Readability $node = $pNode; $elementsToScore[] = $node; } elseif (!NodeUtility::hasSingleChildBlockElement($node)) { - $elementsToScore[] = NodeUtility::setNodeTag($node, 'p'); + $node = NodeUtility::setNodeTag($node, 'p'); + $elementsToScore[] = $node; } else { // EXPERIMENTAL foreach ($node->getChildren() as $child) { |