diff --git a/src/imxml2epub.py b/src/imxml2epub.py index 2cfe5b4..4bc6660 100755 --- a/src/imxml2epub.py +++ b/src/imxml2epub.py @@ -756,7 +756,6 @@ def add_css_snippet(css_snippet, css_file): logging.info(f"{logseparator}Preparing Figures") xmlFigures = xmlEbookTree.xpath(".//EOAfigure[not(contains(@type,'hionly'))]") -libeoaconvert.debug_xml_here(xmlEbookTree, "find_eoafigures", DEBUG_DIR) logging.info("Found %s figures", len(xmlFigures)) for xmlFigure in xmlFigures: # Copy File of the Image @@ -1678,6 +1677,8 @@ class FootnoteError(Exception): logging.info(f"{logseparator}Preparing Cross-References") +# restart chapter counter +intChapterNumber = 1 for xmlChapter in xmlChapters: xmlReferences = xmlChapter.xpath(".//EOAref[not(parent::EOAref)]") for xmlReference in xmlReferences: @@ -1763,13 +1764,14 @@ class FootnoteError(Exception): logging.info("XXXXXXXX") xmlReference.clear() if args.hyperimage and hitarget_id and reference_type in ["collage", "number"]: - hyperimage_link = f"{publication_landingpage[:-11]}/{intChapterNumber - 1}/index.html#{hitarget_id}" + hyperimage_link = f"{publication_landingpage[:-11]}/{intChapterNumber}/index.html#{hitarget_id}" xmlReference.tag = "a" xmlReference.set("href", hyperimage_link) else: pass xmlReference.text = strResult xmlReference.tail = tmpTail + intChapterNumber += 1 # Substitute Page-References with their targets for xmlChapter in xmlChapters: