From 96650c2886b70ee8371312087a1166313f7f9e58 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 2 Jan 2020 20:12:08 -0800 Subject: [PATCH] During opf normalize, ensure ncx mimetype is correct. --- epubfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epubfile.py b/epubfile.py index ce850fe..16d225c 100644 --- a/epubfile.py +++ b/epubfile.py @@ -1106,6 +1106,9 @@ class Epub: for tag in self.opf.descendants: if tag.name: tag.name = tag.name.replace('opf:', '') + for item in self.get_manifest_items(soup=True): + if item['href'] in ['toc.ncx', 'Misc/toc.ncx']: + item['media-type'] = 'application/x-dtbncx+xml' # COMMAND LINE TOOLS