diff --git a/readability/readability.py b/readability/readability.py index fcbab77..680505a 100755 --- a/readability/readability.py +++ b/readability/readability.py @@ -482,7 +482,7 @@ class Document: #if el.tag == 'div' and counts["img"] >= 1: # continue - if counts["p"] and counts["img"] > counts["p"]: + if counts["p"] and counts["img"] > 1+counts["p"]*1.3: reason = "too many images (%s)" % counts["img"] to_remove = True elif counts["li"] > counts["p"] and tag != "ul" and tag != "ol": diff --git a/tests/samples/too-many-images.sample.html b/tests/samples/too-many-images.sample.html new file mode 100644 index 0000000..db14745 --- /dev/null +++ b/tests/samples/too-many-images.sample.html @@ -0,0 +1,2154 @@ + + +
+ + + + + + + + + + + + + + +
Ingen kommentarer:
++
++
Legg inn en kommentar
++
+ + + + +