forked from LiveCarta/BookConverter
epub converter: fix finding full path in internal links processing
This commit is contained in:
@@ -304,9 +304,11 @@ class EpubConverter:
|
|||||||
soup = self.href2soup_html[toc_href]
|
soup = self.href2soup_html[toc_href]
|
||||||
for internal_link_tag in soup.find_all('a', {'href': internal_link_reg2}):
|
for internal_link_tag in soup.find_all('a', {'href': internal_link_reg2}):
|
||||||
a_tag_href, a_tag_id = internal_link_tag.attrs['href'].split('#')
|
a_tag_href, a_tag_id = internal_link_tag.attrs['href'].split('#')
|
||||||
a_tag_href = a_tag_href or toc_href
|
|
||||||
# find full path
|
# find full path
|
||||||
a_tag_href_matched_to_toc = self.match_href_to_path_from_toc(toc_href, a_tag_href, internal_link_tag)
|
if a_tag_href:
|
||||||
|
a_tag_href_matched_to_toc = self.match_href_to_path_from_toc(toc_href, a_tag_href, internal_link_tag)
|
||||||
|
else:
|
||||||
|
a_tag_href_matched_to_toc = os.path.normpath(toc_href).replace('\\', '/')
|
||||||
if not a_tag_href_matched_to_toc:
|
if not a_tag_href_matched_to_toc:
|
||||||
continue
|
continue
|
||||||
new_id = self._create_unique_id(a_tag_href_matched_to_toc, a_tag_id)
|
new_id = self._create_unique_id(a_tag_href_matched_to_toc, a_tag_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user