Edit Book: Enable editing of page map XML files

This commit is contained in:
Kovid Goyal 2014-01-28 10:06:09 +05:30
parent 21971d0e25
commit 77edd3a7a9
2 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,8 @@ def check_mimetypes(container):
for name, mt in container.mime_map.iteritems():
gt = container.guess_type(name)
if mt != gt:
if mt == 'application/oebps-page-map+xml' and name.lower().endswith('.xml'):
continue
a(MimetypeMismatch(container, name, mt, gt))
return errors

View File

@ -16,7 +16,7 @@ def syntax_from_mime(name, mime):
return 'html'
if mime in OEB_STYLES:
return 'css'
if mime in {guess_type('a.opf'), guess_type('a.ncx'), guess_type('a.xml')}:
if mime in {guess_type('a.opf'), guess_type('a.ncx'), guess_type('a.xml'), 'application/oebps-page-map+xml'}:
return 'xml'
if mime.startswith('text/'):
return 'text'