From a078a7a42a99bcc5995a6a75c5adf3918a5d2b8f Mon Sep 17 00:00:00 2001 From: shirshasa Date: Mon, 12 Jul 2021 08:10:55 +0300 Subject: [PATCH] epub converter: small fix --- src/html_epub_preprocessor.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/html_epub_preprocessor.py b/src/html_epub_preprocessor.py index d783a47..4913477 100644 --- a/src/html_epub_preprocessor.py +++ b/src/html_epub_preprocessor.py @@ -58,6 +58,8 @@ def update_src_links_in_images(body_tag: Tag, del img.attrs['width'] if img.attrs.get('height'): del img.attrs['height'] + if img.attrs.get('style'): + del img.attrs['style'] return path2aws_path @@ -233,16 +235,6 @@ def preprocess_footnotes(source_html_tag: Tag, href2soup_html: dict = None, note return tags - def get_footnote_tags2str(t): - unicode_string = '' - for child in t.children: - if type(child) is NavigableString: - unicode_string += str(child) - else: - unicode_string += child.decode_contents() - - return unicode_string.strip() - for i, noteref_tag in enumerate(noterefs_tags): href = noteref_tag.attrs['href'] file, element_id = parse_a_tag_href(href)