From 43e16ed8d22aa32e2688c15616184be9fc1aefc9 Mon Sep 17 00:00:00 2001 From: Kiryl Date: Wed, 22 Jun 2022 18:20:57 +0300 Subject: [PATCH] Convert div to table (width, border, bgcolor in attr) --- src/epub_converter/html_epub_preprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/epub_converter/html_epub_preprocessor.py b/src/epub_converter/html_epub_preprocessor.py index e46e46d..87c98c9 100644 --- a/src/epub_converter/html_epub_preprocessor.py +++ b/src/epub_converter/html_epub_preprocessor.py @@ -276,7 +276,7 @@ def _preprocess_div_tags(chapter_tag): Function replace
with : """ for div in chapter_tag.find_all("div"): - if div.attrs.get('style'): + if any(attr in ['width', 'border', 'bgcolor'] for attr in div.attrs): _wrap_tag_with_table( chapter_tag, tag_to_be_wrapped=div,