8000 Merge pull request #29 from hush-hush/master · Harry0201/python-readability@4e3192f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e3192f

Browse files
committed
Merge pull request buriy#29 from hush-hush/master
Make lxml clean tree available for user modifications
2 parents c923995 + e2e78e4 commit 4e3192f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readability/readability.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def title(self):
123123
def short_title(self):
124124
return shorten_title(self._html(True))
125125

126+
def get_clean_html(self):
127+
return clean_attributes(tounicode(self.html))
128+
126129
def summary(self, html_partial=False):
127130
"""Generate the summary of the html docuemnt
128131
@@ -530,7 +533,8 @@ def sanitize(self, node, candidates):
530533
#el.attrib = {} #FIXME:Checkout the effects of disabling this
531534
pass
532535

533-
return clean_attributes(tounicode(node))
536+
self.html = node
537+
return self.get_clean_html()
534538

535539

536540
class HashableElement():

0 commit comments

Comments
 (0)
0