Changed the subclass of lxml.html.clean.Cleaner() to adapt to changes in the superclass in v4.5.2
- Legacy-Id: 18146
This commit is contained in:
parent
0edf58c0a2
commit
1e1f056053
|
@ -57,6 +57,10 @@ def sanitize_fragment(html):
|
|||
|
||||
class Cleaner(lxml.html.clean.Cleaner):
|
||||
charset = 'utf-8'
|
||||
def __init__(self, charset='utf-8', **kw):
|
||||
self.charset = charset
|
||||
super(Cleaner, self).__init__(**kw)
|
||||
|
||||
# Copied from lxml 4.2.0 and modified to insert charset meta:
|
||||
def clean_html(self, html):
|
||||
result_type = type(html)
|
||||
|
|
Loading…
Reference in a new issue