Fix #2063549 [lxml has split out lxml.html.clean into a separate project](https://bugs.launchpad.net/calibre/+bug/2063549)

This commit is contained in:
Kovid Goyal 2024-04-26 12:11:22 +05:30
parent 63a3852c9f
commit d68e11b2b9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1,7 +1,10 @@
# strip out a set of nuisance html attributes that can mess up rendering in RSS feeds
import re
from lxml.html.clean import Cleaner
try:
from lxml_html_clean import Cleaner
except ImportError:
from lxml.html.clean import Cleaner
bad_attrs = ['width', 'height', 'style', '[-a-z]*color', 'background[-a-z]*', 'on*']
single_quoted = "'[^']+'"