converter fix: toc links processing

This commit is contained in:
shirshasa
2020-10-29 18:18:46 +03:00
parent 65cd124c9d
commit 813c5962c9

View File

@@ -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: