From 681bf0c47b235577fb40848a6092d0d07f7d95dc Mon Sep 17 00:00:00 2001 From: PalmerAL Date: Mon, 4 Mar 2019 18:05:49 -0600 Subject: [PATCH] use default threshold for share elements --- Readability.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Readability.js b/Readability.js index 35e0d7d..7283a40 100644 --- a/Readability.js +++ b/Readability.js @@ -579,9 +579,12 @@ Readability.prototype = { // Clean out elements with little content that have "share" in their id/class combinations from final top candidates, // which means we don't remove the top candidates even they have "share". + + var shareElementThreshold = this.DEFAULT_CHAR_THRESHOLD + this._forEachNode(articleContent.children, function (topCandidate) { this._cleanMatchedNodes(topCandidate, function (node, matchString) { - return /share/.test(matchString) && node.textContent.length < 500; + return /share/.test(matchString) && node.textContent.length < shareElementThreshold; }); });