diff --git a/packages/readabilityjs/Readability.js b/packages/readabilityjs/Readability.js
index dea3d7a7a..dd4b6446f 100644
--- a/packages/readabilityjs/Readability.js
+++ b/packages/readabilityjs/Readability.js
@@ -1321,8 +1321,8 @@ Readability.prototype = {
// Add a point for the paragraph itself as a base.
contentScore += 1;
- // Add points for any commas within this paragraph.
- contentScore += innerText.split(",").length;
+ // Add points for any commas (including those in CJK language) within this paragraph.
+ contentScore += innerText.split(/[,,、]/g).length;
// For every 100 characters in this paragraph, add another point. Up to 3 points.
contentScore += Math.min(Math.floor(innerText.length / 100), 3);
@@ -2804,6 +2804,22 @@ Readability.prototype = {
(weight >= 25 && linkDensity > 0.5 && !(node.className === "tweet" && linkDensity === 1)) ||
((embedCount === 1 && contentLength < 75) || embedCount > 1))
+ // Allow simple lists of images to remain in pages
+ if (isList && haveToRemove) {
+ for (var x = 0; x < node.children.length; x++) {
+ let child = node.children[x];
+ // Don't filter in lists with li's that contain more than one child
+ if (child.children.length > 1) {
+ return haveToRemove;
+ }
+ }
+ var li_count = node.getElementsByTagName("li").length;
+ // Only allow the list to remain if every li contains an image
+ if (img === li_count) {
+ return false;
+ }
+ }
+
if (haveToRemove) {
this.log("Cleaning Conditionally", { className: node.className, children: Array.from(node.children).map(ch => ch.tagName) });
}
diff --git a/packages/readabilityjs/test/test-pages/wechat/expected.html b/packages/readabilityjs/test/test-pages/wechat/expected.html
index 9bb732b73..dc3a91c89 100644
--- a/packages/readabilityjs/test/test-pages/wechat/expected.html
+++ b/packages/readabilityjs/test/test-pages/wechat/expected.html
@@ -1,387 +1,389 @@