Skip to content

Commit

Permalink
Don't run prepArticle() if there's no content
Browse files Browse the repository at this point in the history
  • Loading branch information
fivefilters committed Jan 14, 2023
1 parent c259830 commit 973fbb0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Readability.php
Original file line number Diff line number Diff line change
Expand Up @@ -1565,9 +1565,8 @@ private function rateNodes($nodes)
}
}

$articleContent = $this->prepArticle($articleContent);

if ($hasContent) {
$articleContent = $this->prepArticle($articleContent);
// Find out text direction from ancestors of final top candidate.
$ancestors = array_merge([$parentOfTopCandidate, $topCandidate], $parentOfTopCandidate->getNodeAncestors());
foreach ($ancestors as $ancestor) {
Expand Down

0 comments on commit 973fbb0

Please sign in to comment.