From 813c5962c9b611da5371ea2c4071f7112907107a Mon Sep 17 00:00:00 2001 From: shirshasa Date: Thu, 29 Oct 2020 18:18:46 +0300 Subject: [PATCH] converter fix: toc links processing --- src/html_preprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: