diff options
author | Andres Rey <[email protected]> | 2017-11-06 00:01:41 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-06 00:01:41 +0000 |
commit | c1cf2c1a2ea5424797a7d2afe9defdc9c1e6d917 (patch) | |
tree | 1c3e7b4d36472d0bf6d9eab3cd5f2a61384fd71b | |
parent | 56d2c4c1d9a3457be5dcf9ccf7f9d2b31c467e1e (diff) |
Keep potential top candidate's parent node to try to get text direction of it later.
-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; |