diff options
Diffstat (limited to 'src/HTMLParser.php')
-rw-r--r-- | src/HTMLParser.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index b6d58ef..f8d2342 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -909,7 +909,9 @@ class HTMLParser $articleContent->createElement('div'); $siblingScoreThreshold = max(10, $topCandidate->getContentScore() * 0.2); - $siblings = $topCandidate->getParent()->getChildren(); + // Keep potential top candidate's parent node to try to get text direction of it later. + $parentOfTopCandidate = $topCandidate->getParent(); + $siblings = $parentOfTopCandidate->getChildren(); $hasContent = false; |