forked from LiveCarta/BookConverter
epub converter: add internal links processing 7
-figure -links without id - img width, height
This commit is contained in:
@@ -53,6 +53,10 @@ def update_src_links_in_images(body_tag: Tag,
|
||||
new_folder = save_image_locally(path_to_img_from_root, img_content, 'book_id')
|
||||
|
||||
img.attrs['src'] = str(new_folder)
|
||||
if img.attrs.get('width'):
|
||||
del img.attrs['width']
|
||||
if img.attrs.get('height'):
|
||||
del img.attrs['height']
|
||||
|
||||
return path2aws_path
|
||||
|
||||
@@ -269,6 +273,14 @@ def unwrap_structural_tags(body_tag):
|
||||
_add_span_to_save_ids_for_links(s)
|
||||
s.unwrap()
|
||||
|
||||
for s in body_tag.find_all("figure"):
|
||||
s.name = 'p'
|
||||
s.attrs['style'] = "text-align: center;"
|
||||
|
||||
for s in body_tag.find_all("figcaption"):
|
||||
_add_span_to_save_ids_for_links(s)
|
||||
s.unwrap()
|
||||
|
||||
for s in body_tag.find_all("aside"):
|
||||
s.name = 'blockquote'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user