summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-08 19:13:18 +0000
committerAndres Rey <[email protected]>2017-11-08 19:13:18 +0000
commitff6da019319e323c520dcab958dcd2c7c96fc2fd (patch)
tree3662f42dc75259e4456e6444fc937786b7aba0be
parent840cac3acba875d98b245f9d512ef6eebd8f50fd (diff)
Remove BR cleaning on text nodes temporarily
-rw-r--r--src/HTMLParser.php19
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;
}