Skip to content

Commit

Permalink
Disregard the note element that is in the letter header
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed May 27, 2020
1 parent 3c10d2f commit a0167c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imxml2epub.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-05-27 09:09:09 (kthoden)>
# Time-stamp: <2020-05-27 11:07:24 (kthoden)>

""" Convert a customized DocBook XML file into a set of files that
constitute the contents of an EPUB file.
Expand Down Expand Up @@ -1043,7 +1043,7 @@ class FootnoteError(Exception):

for xmlChapter in xmlChapters:
groupings = libeoaconvert.get_bigfoot_data(xmlChapter)
xmlFootnotes = list(xmlChapter.findall(".//note"))
xmlFootnotes = xmlChapter.xpath(".//note[not(ancestor::opener)]")
logging.info("Here come the footnotes. Found " + str(len(xmlFootnotes)))
has_old = 0 != len(xmlFootnotes)
has_new = 0 != len(
Expand Down
6 changes: 6 additions & 0 deletions src/tei2imxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,12 @@ def handle_refs_default(ref):
hilayer = ref.get("select")
logging.debug(f"Found hyperimage annotation layer {hilayer}")
ref_subelement.set("data-hilayer", hilayer)
elif type_attribute == "page":
ref.tag = "EOApageref"
del ref.attrib["type"]
del ref.attrib["target"]
etree.SubElement(ref, "ref", teitarget=target_attribute)
etree.SubElement(ref, "Label").text = target_attribute[1:]
else:
ref.tag = "EOAref"
del ref.attrib["target"]
Expand Down

0 comments on commit a0167c4

Please sign in to comment.