8000 Merge pull request #24 from zacharydenton/master · optionalg/python-readability@4491551 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4491551

Browse files
committed
Merge pull request buriy#24 from zacharydenton/master
Fix issue 22: all titles were blank.
2 parents 8aefc61 + 0843d9c commit 4491551

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readability/htmls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def norm_title(title):
4444

4545
def get_title(doc):
4646
title = doc.find('.//title')
47-
if not title or not title.text:
47+
if title is None or len(title.text) == 0:
4848
return '[no-title]'
4949

5050
return norm_title(title.text)
@@ -57,7 +57,7 @@ def add_match(collection, text, orig):
5757

5858
def shorten_title(doc):
5959
title = doc.find('.//title')
60-
if not title or not title.text:
60+
if title is None or len(title.text) == 0:
6161
return ''
6262

6363
title = orig = norm_title(title.text)

0 commit comments

Comments
 (0)
0