8000 Make lxml clean tree available for user modifications. · petrichorcode/python-readability@e2e78e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2e78e4

Browse files
hush-hushMaxime Mouial
authored andcommitted
Make lxml clean tree available for user modifications.
1 parent c923995 commit e2e78e4

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