From 776cf1ea12179d00f1a7cef90e26ff9fe8c2b141 Mon Sep 17 00:00:00 2001 From: shirshasa Date: Fri, 9 Jul 2021 11:16:31 +0300 Subject: [PATCH] epub converter: update footnotes --- src/html_epub_preprocessor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/html_epub_preprocessor.py b/src/html_epub_preprocessor.py index c7c0981..886d072 100644 --- a/src/html_epub_preprocessor.py +++ b/src/html_epub_preprocessor.py @@ -255,8 +255,10 @@ def preprocess_footnotes(source_html_tag: Tag, href2soup_html: dict = None, note expected_footnote_tags = verify_footnote_tag(expected_footnote_tags) footnote_tag = expected_footnote_tags[0] + if footnote_tag.parent.attrs.get('role') and footnote_tag.parent.attrs.get('role') == 'doc-endnote': + footnote_tag = footnote_tag.parent replace_with_livecarta_anchor_tag(noteref_tag, i) - content = get_footnote_tags2str(footnote_tag) + content = footnote_tag.text footnote_tag.decompose() footnotes.append(content)