Skip to content

Commit

Permalink
Fixed #49. Bump to 0.6.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
buriy committed Jul 27, 2015
1 parent c51886d commit fcdbe56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion readability/readability.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ def _parse(self, input):
doc = html_cleaner.clean_html(doc)
base_href = self.url
if base_href:
doc.make_links_absolute(base_href, resolve_base_href=True)
# trying to guard against bad links like <a href="http://[http://...">
try:
# such support is added in lxml 3.3.0
doc.make_links_absolute(base_href, resolve_base_href=True, handle_failures='discard')
except TypeError: #make_links_absolute() got an unexpected keyword argument 'handle_failures'
# then we have lxml < 3.3.0
# please upgrade to lxml >= 3.3.0 if you're failing here!
doc.make_links_absolute(base_href, resolve_base_href=True)
else:
doc.resolve_base_href()
return doc
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name="readability-lxml",
version="0.6.0.3",
version="0.6.0.4",
author="Yuri Baburov",
author_email="burchik@gmail.com",
description="fast python port of arc90's readability tool",
Expand Down

0 comments on commit fcdbe56

Please sign in to comment.