diff options
Diffstat (limited to 'src/Readability.php')
-rw-r--r-- | src/Readability.php | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/Readability.php b/src/Readability.php index 5a1a6e9..adda48a 100644 --- a/src/Readability.php +++ b/src/Readability.php @@ -49,12 +49,7 @@ class Readability extends Element implements ReadabilityInterface $score = 0; if (!in_array(get_class($node), ['DOMDocument', 'DOMComment'])) { - try { $score = $node->getAttribute('readability'); - - } catch (\Error $e) { - $test=1; - } } $this->setContentScore(($score) ? $score : 0); @@ -114,7 +109,7 @@ class Readability extends Element implements ReadabilityInterface $node = $this; - while ($node && $node->getParent()) { + while (($node) ? $node->getParent() : $node) { $ancestors[] = new static($node->node); $level++; if ($level >= $maxLevel) { |