epub converter: small fix

This commit is contained in:
shirshasa
2021-09-07 16:08:59 +03:00
parent 786d9e3a48
commit 4337a69d36
3 changed files with 6 additions and 4 deletions

View File

@@ -285,7 +285,7 @@ class EpubConverter:
del internal_link_tag.attrs['href']
# 2.a) process anchor which is a an element in xhtml file
# 2.b) process anchor which is a an element in xhtml file
internal_link_reg2 = re.compile(r'(^.+\.(html|xhtml)\#.+)|(^\#.+)')
for toc_href in self.added_to_toc_hrefs:
soup = self.href2soup_html[toc_href]
@@ -304,7 +304,8 @@ class EpubConverter:
if anchor_tags:
if len(anchor_tags) > 1:
self.logger.log(f'Warning in {toc_href}: multiple anchors: {len(anchor_tags)} found.'
self.logger.log(f'Warning in {toc_href}: multiple anchors: {len(anchor_tags)} found.\n'
f'{anchor_tags}\n'
f' While processing {internal_link_tag}')
anchor_tag = anchor_tags[0]