Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Footnotes without IDs are dangerous
  • Loading branch information
kthoden committed Jul 30, 2019
1 parent d59a04f commit 1aad91b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tei2imxml.py
Expand Up @@ -618,7 +618,11 @@ def handle_refs_hyperimage(ref):

fn_parent = footnote.getparent()
# we assert here that the parent of a footnote is always a paragraph or a quote
footnote_id = footnote.xpath("@xml:id")[0]
try:
footnote_id = footnote.xpath("@xml:id")[0]
except IndexError:
logging.error("Found footnote without xml:id. Exiting.")
sys.exit(1)

# logging.debug(f"The prefix of fn_parent is {fn_parent.prefix}.")

Expand Down

0 comments on commit 1aad91b

Please sign in to comment.