diff --git a/imxml2epub.py b/imxml2epub.py index fb3b6f6..46a63eb 100755 --- a/imxml2epub.py +++ b/imxml2epub.py @@ -519,6 +519,7 @@ def addToTocncx(tocncx, Label, intTechnicalChapterNumber): contentopf = addToContentopf(contentopf, content_opf_filename, content_opf_fileid, extension_and_mime) idFigure = xmlFigure.find(".//anchor").get("id") + xmlFigureCaption = xmlFigure.find(".//caption") intFigureNumber = dictFigures[idFigure] if xmlFigure.tag == "EOAfigure": strImageWidth = xmlFigure.find(".//width").text @@ -536,7 +537,6 @@ def addToTocncx(tocncx, Label, intTechnicalChapterNumber): if args.nocaption: pass else: - xmlFigureCaption = xmlFigure.find(".//caption") xmlFigureCaption.tag = "p" strFigureCaption = xmlFigureCaption.text or "" # FIX