forked from LiveCarta/BookConverter
converter fix: toc links processing
This commit is contained in:
@@ -392,7 +392,7 @@ class HTMLPreprocessor:
|
|||||||
|
|
||||||
def _check_parent_link_exist_in_toc(self, tag_with_link):
|
def _check_parent_link_exist_in_toc(self, tag_with_link):
|
||||||
toc_links = []
|
toc_links = []
|
||||||
for a_tag in tag_with_link.find_all('a'):
|
for a_tag in tag_with_link.find_all("a", {'name': re.compile(r'^_Toc\d+')}):
|
||||||
link_name = a_tag.attrs['name']
|
link_name = a_tag.attrs['name']
|
||||||
toc_item = self.body_tag.find("a", {'href': '#' + link_name})
|
toc_item = self.body_tag.find("a", {'href': '#' + link_name})
|
||||||
if toc_item:
|
if toc_item:
|
||||||
|
|||||||
Reference in New Issue
Block a user