summaryrefslogtreecommitdiff
path: root/src/Readability.php
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2018-11-11 19:33:08 +0000
committerAndres Rey <[email protected]>2018-11-11 19:33:08 +0000
commit63accc8c8a7e16d337b24212781c00abcfb0ed96 (patch)
treea047fb3191567784ed18f932a75bcfea3ea50a9f /src/Readability.php
parentae902403088af4b0a4266fb01041e0d614e4ed66 (diff)
Fix issue when removing brs
Diffstat (limited to 'src/Readability.php')
-rw-r--r--src/Readability.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Readability.php b/src/Readability.php
index eadd50d..02938e3 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -877,8 +877,8 @@ class Readability
$next = $sibling;
}
- while ($p->lastChild && preg_match(NodeUtility::$regexps['whitespace'], $p->lastChild->textContent)) {
- $p->parentNode->removeChild($p->lastChild);
+ while ($p->lastChild && $p->lastChild->isWhitespace()) {
+ $p->removeChild($p->lastChild);
}
if ($p->parentNode->tagName === "p") {