converter bug fix

This commit is contained in:
Svitin Egor
2025-03-24 08:15:10 +03:00
parent eff687ab46
commit be6e85ec11

View File

@@ -289,7 +289,7 @@ class EpubConverter:
for i in self.html_href2subchapters_ids[html_href]:
tag = soup.find(id=i)
# in order not to lose tags in verification of same level in chapter
parent_tags = tag.find_parents(['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5'])
parent_tags = tag.find_parents(['body', 'p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5'])
parent_tag = parent_tags[-1] if parent_tags else tag
tmp_tag = soup.new_tag("lc_tmp")
tmp_tag.attrs["class"] = "converter-chapter-mark"