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:
Henrik Levkowetz 2020-07-11 20:20:50 +00:00
parent 0edf58c0a2
commit 1e1f056053

View file

@ -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)