diff --git a/Readability.js b/Readability.js index 62b6a48..b62f41a 100644 --- a/Readability.js +++ b/Readability.js @@ -1141,7 +1141,7 @@ Readability.prototype = { this._attempts.push({articleContent: articleContent, textLength: textLength}); // No luck after removing flags, just return the longest text we found during the different loops this._attempts.sort(function (a, b) { - return a.textLength < b.textLength; + return (a.textLength < b.textLength) ? 1 : -1; }); // But first check if we actually have something