Skip to content

Commit 638f73f

Browse files
committed
Fix for #52: <input type="hidden"> are not counted any more for "form removal" heuristic.
1 parent 2fab5ff commit 638f73f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

readability/readability.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ def sanitize(self, node, candidates):
452452
for kind in ['p', 'img', 'li', 'a', 'embed', 'input']:
453453
counts[kind] = len(el.findall('.//%s' % kind))
454454
counts["li"] -= 100
455+
counts["input"] -= len(el.findall('.//input[@type="hidden"]'))
455456

456457
# Count the text length excluding any surrounding whitespace
457458
content_length = text_length(el)

0 commit comments

Comments
 (0)