diff --git a/Readability.js b/Readability.js index 410078e..0d94eaa 100644 --- a/Readability.js +++ b/Readability.js @@ -1598,6 +1598,7 @@ Readability.prototype = { var tagsList = e.getElementsByTagName(tag); var curTagsLength = tagsList.length; + var isList = tag === "ul" || tag === "ol"; // Gather counts for other typical elements embedded within. // Traverse backwards so we can remove nodes at the same time @@ -1633,13 +1634,13 @@ Readability.prototype = { var toRemove = false; if (img > p && !this._hasAncestorTag(tagsList[i], "figure")) { toRemove = true; - } else if (li > p && tag !== "ul" && tag !== "ol") { + } else if (!isList && li > p) { toRemove = true; - } else if ( input > Math.floor(p/3) ) { + } else if (input > Math.floor(p/3)) { toRemove = true; - } else if (contentLength < 25 && (img === 0 || img > 2) ) { + } else if (!isList && contentLength < 25 && (img === 0 || img > 2)) { toRemove = true; - } else if (weight < 25 && linkDensity > 0.2) { + } else if (!isList && weight < 25 && linkDensity > 0.2) { toRemove = true; } else if (weight >= 25 && linkDensity > 0.5) { toRemove = true; diff --git a/test/test-pages/002/expected.html b/test/test-pages/002/expected.html index b218925..495af03 100644 --- a/test/test-pages/002/expected.html +++ b/test/test-pages/002/expected.html @@ -288,6 +288,14 @@ apiCall.then(function(respon

Dealing with bodies

Both Requests and Responses may contain body data. We’ve been glossing over it because of the various data types body may contain, but we will cover it in detail now.

A body is an instance of any of the following types.

+

In addition, Request and Response both offer the following methods to extract their body. These all return a Promise that is eventually resolved with the actual content.