diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Readability.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Readability.php b/src/Readability.php index e0c9abf..323cdc2 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -842,6 +842,14 @@ class Readability $p->appendChild($next); $next = $sibling; } + + while ($p->lastChild && preg_match(NodeUtility::$regexps['whitespace'], $p->lastChild->textContent)) { + $p->parentNode->removeChild($p->lastChild); + } + + if ($p->parentNode->tagName === "p") { + NodeUtility::setNodeTag($p->parentNode, 'div'); + } } } |