During opf normalize, ensure ncx mimetype is correct.

This commit is contained in:
Ethan Dalool 2020-01-02 20:12:08 -08:00
parent 046e8d9394
commit 96650c2886

View file

@ -1106,6 +1106,9 @@ class Epub:
for tag in self.opf.descendants: for tag in self.opf.descendants:
if tag.name: if tag.name:
tag.name = tag.name.replace('opf:', '') 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 # COMMAND LINE TOOLS