summaryrefslogtreecommitdiff
path: root/src/Readability.php
diff options
context:
space:
mode:
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") {