remove body tag

This commit is contained in:
Svitin Egor
2025-03-27 13:34:53 +03:00
parent 9fd63a6345
commit 9be0a46162

View File

@@ -298,7 +298,7 @@ class EpubConverter:
for i in self.html_href2subchapters_ids[html_href]: for i in self.html_href2subchapters_ids[html_href]:
tag = soup.find(id=i) tag = soup.find(id=i)
# in order not to lose tags in verification of same level in chapter # in order not to lose tags in verification of same level in chapter
parent_tags = tag.find_parents(['body', 'p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'header']) parent_tags = tag.find_parents(['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'header'])
parent_tag = parent_tags[-1] if parent_tags else tag parent_tag = parent_tags[-1] if parent_tags else tag
self.book_logger.log("Found tag " + parent_tag.name + " for " + i) self.book_logger.log("Found tag " + parent_tag.name + " for " + i)
new_unique_id = self.create_unique_id(html_href, '') new_unique_id = self.create_unique_id(html_href, '')