From d68e11b2b9b3b145ee6f8a4ea358738331b11c2b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 26 Apr 2024 12:11:22 +0530 Subject: [PATCH] Fix #2063549 [lxml has split out lxml.html.clean into a separate project](https://bugs.launchpad.net/calibre/+bug/2063549) --- src/calibre/ebooks/readability/cleaners.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/readability/cleaners.py b/src/calibre/ebooks/readability/cleaners.py index fee5aec96f..cd52fe2580 100644 --- a/src/calibre/ebooks/readability/cleaners.py +++ b/src/calibre/ebooks/readability/cleaners.py @@ -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 = "'[^']+'"