From f543758fdd441bef202e6cc1bd8fe9fa3a933958 Mon Sep 17 00:00:00 2001 From: shirshasa Date: Mon, 25 May 2020 14:55:08 +0300 Subject: [PATCH] save footnotes formatting --- src/book.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/book.py b/src/book.py index 3b5a1f7..7c19a59 100644 --- a/src/book.py +++ b/src/book.py @@ -462,7 +462,6 @@ class Book: @staticmethod def _clean_footnote_content(content): content = content.strip() - content = re.sub(r'^\d+ ?', '', content) return content.strip() def _process_footnotes(self): @@ -486,7 +485,8 @@ class Book: new_tag.string = '*' anc_tag.replace_with(new_tag) - content = self._clean_footnote_content(cont_tag.text) + cont_tag.a.decompose() + content = self._clean_footnote_content(cont_tag.p.decode_contents()) cont_tag.decompose() # new_tag = BeautifulSoup(features="lxml").new_tag('div')