diff options
Diffstat (limited to 'src/HTMLParser.php')
-rw-r--r-- | src/HTMLParser.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 273dab9..8f00eda 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -1053,15 +1053,16 @@ class HTMLParser $this->_cleanReadabilityTags($article); - $brs = $article->getElementsByTagName('br'); - $length = $brs->length; - for ($i = 0; $i < $length; $i++) { - $node = $brs->item($length - 1 - $i); - $next = $node->nextSibling; - if ($next && $next->nodeName === 'p') { - $node->parentNode->removeChild($node); - } - } + // TODO: Check if we can actually remove this. Removes BRs from text nodes. +// $brs = $article->getElementsByTagName('br'); +// $length = $brs->length; +// for ($i = 0; $i < $length; $i++) { +// $node = $brs->item($length - 1 - $i); +// $next = $node->nextSibling; +// if ($next && $next->nodeType === XML_TEXT_NODE) { +// $node->parentNode->removeChild($node); +// } +// } return $article; } |