epub converter: prettifying

This commit is contained in:
shirshasa
2021-06-07 17:40:50 +03:00
parent eba46574fc
commit d3c5c8d662

View File

@@ -12,7 +12,7 @@ from ebooklib import epub
from ebooklib.epub import Link, Section from ebooklib.epub import Link, Section
from data_objects import ChapterItem, NavPoint from data_objects import ChapterItem, NavPoint
from html_epub_preprocessor import unwrap_structural_tags, get_tags_between_ids, prepare_title_and_content, \ from html_epub_preprocessor import unwrap_structural_tags, get_tags_between_chapter_marks, prepare_title_and_content, \
update_src_links_in_images, preprocess_footnotes update_src_links_in_images, preprocess_footnotes
from css_reader import clean_css, add_inline_style_to_html_soup from css_reader import clean_css, add_inline_style_to_html_soup
@@ -309,7 +309,7 @@ class EpubPostprocessor:
""" """
if node.id: if node.id:
soup = self.href2soup_html[node.href] soup = self.href2soup_html[node.href]
chapter_tags = get_tags_between_ids(first_id=node.id, href=node.href, html_soup=soup) chapter_tags = get_tags_between_chapter_marks(first_id=node.id, href=node.href, html_soup=soup)
new_tree = BeautifulSoup('', 'html.parser') new_tree = BeautifulSoup('', 'html.parser')
for tag in chapter_tags: for tag in chapter_tags:
new_tree.append(tag) new_tree.append(tag)