Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
don't double-denote footnotes in epub
  • Loading branch information
calcnerd256 committed Mar 22, 2016
1 parent d6f5a6d commit f31fad9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Skripten/EOAconvert.py
Expand Up @@ -1578,6 +1578,9 @@ def bring_footnote_down_epub(footnote, footnote_name, destination):
"""
captures reusable behavior from the existing code
potentially, some of the old code could be replaced by calls to this helper
usage: contentopf = bring_footnote_down_epub(my_footnote, "1", xmlNewFootnotes)
unfortunately, returning the result seemed like a better idea than mutating the global variable
"""

contentopf = replace_footnote_equations(footnote) # see usage note
Expand All @@ -1587,7 +1590,7 @@ def bring_footnote_down_epub(footnote, footnote_name, destination):
# we would like to prepend this footnote identifier to the footnote element
if footnote.text is not None:
# if the element starts with some text anyway, prepend it there
footnote.text = "%s %s" (prefix, footnote.text)
footnote.text = "%s %s" % (prefix, footnote.text)
else:
# if, however, the element begins with a child, prepend the text at the beginning of the first child instead
if len(kids):
Expand Down Expand Up @@ -1668,7 +1671,6 @@ class FootnoteError(Exception):
if "lower-latin" == grouping:
footnote_name = alph_footnote_index(index)
para = etree.Element("p")
para.text = "[%s] %s" % (footnote_name, note.text)
contentopf = bring_footnote_down_epub(note, footnote_name, para)
xmlNewFootnotes.append(para)
intFootnoteNumber = 1
Expand Down Expand Up @@ -2883,6 +2885,9 @@ def bring_footnote_down_django(footnote, fragment, footnote_number, object_numbe
"""
captures reusable behavior from the existing code
potentially, some of the old code could be replaced by calls to this helper
usage: intObjectNumber = bring_footnote_down_django(xmlFootnote, "fn"+str(intFootnoteNumber), str(intFootnoteNumber), intObjectNumber, tmpStrUID, xmlResult)
unfortunately, returning the result seemed like a better idea than mutating the global variable
"""

kids = list(footnote.getchildren())
Expand Down

0 comments on commit f31fad9

Please sign in to comment.