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)