save footnotes formatting

This commit is contained in:
shirshasa
2020-05-25 14:55:08 +03:00
parent 0dd163cfb3
commit f543758fdd

View File

@@ -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')