8000 Added a feature to allow more images per article (with a test) · zyq001/python-readability@1fac7e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fac7e6

Browse files
committed
Added a feature to allow more images per article (with a test)
1 parent c679619 commit 1fac7e6

File tree

3 files changed

+2162
-1
lines changed

3 files changed

+2162
-1
lines changed

readability/readability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def sanitize(self, node, candidates):
482482

483483
#if el.tag == 'div' and counts["img"] >= 1:
484484
# continue
485-
if counts["p"] and counts["img"] > counts["p"]:
485+
if counts["p"] and counts["img"] > 1+counts["p"]*1.3:
486486
reason = "too many images (%s)" % counts["img"]
487487
to_remove = True
488488
elif counts["li"] > counts["p"] and tag != "ul" and tag != "ol":

0 commit comments

Comments
 (0)
0