summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2018-09-02 20:34:54 +0100
committerAndres Rey <[email protected]>2018-09-02 20:34:54 +0100
commit41c0328fd6253e57f0e4cd1607e8c489826fe6a4 (patch)
tree23f790c372395304b58b069a526ae02652bbc501 /src
parent7a3993d6e5aa41467bd9b09e4dff3966f3e673b7 (diff)
Remove DOMComments before anything else
Diffstat (limited to 'src')
-rw-r--r--src/Readability.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Readability.php b/src/Readability.php
index aadd631..2cad398 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -617,8 +617,6 @@ class Readability
*/
while ($node) {
- $matchString = $node->getAttribute('class') . ' ' . $node->getAttribute('id');
-
// Remove DOMComments nodes as we don't need them and mess up children counting
if ($node->nodeType === XML_COMMENT_NODE) {
$this->logger->debug(sprintf('[Get Nodes] Found comment node, removing... Node content was: \'%s\'', substr($node->nodeValue, 0, 128)));
@@ -626,6 +624,8 @@ class Readability
continue;
}
+ $matchString = $node->getAttribute('class') . ' ' . $node->getAttribute('id');
+
// Check to see if this node is a byline, and remove it if it is.
if ($this->checkByline($node, $matchString)) {
$this->logger->debug(sprintf('[Get Nodes] Found byline, removing... Node content was: \'%s\'', substr($node->nodeValue, 0, 128)));