diff --git a/src/html_preprocessor.py b/src/html_preprocessor.py index 109b4e8..d8c19cb 100644 --- a/src/html_preprocessor.py +++ b/src/html_preprocessor.py @@ -392,7 +392,7 @@ class HTMLPreprocessor: def _check_parent_link_exist_in_toc(self, tag_with_link): 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'] toc_item = self.body_tag.find("a", {'href': '#' + link_name}) if toc_item: