Add EPUB format to Zotero.MIME

This commit is contained in:
Abe Jellinek 2023-06-26 15:48:04 -04:00 committed by Dan Stillman
parent d6547bab34
commit ba1b1b0639
3 changed files with 10 additions and 1 deletions

View file

@ -47,6 +47,7 @@ Zotero.MIME = new function(){
["FLV", "video/x-flv", 0],
["\u0000\u0000\u0001\u0000", "image/vnd.microsoft.icon", 0],
["SQLite format 3\u0000", "application/x-sqlite3", 0],
["mimetypeapplication/epub+zip", "application/epub+zip", 30],
];
var _extensions = {
@ -81,7 +82,8 @@ Zotero.MIME = new function(){
// OpenOffice/LibreOffice
'odt': 'application/vnd.oasis.opendocument.text',
'pdf': 'application/pdf'
'pdf': 'application/pdf',
'epub': 'application/epub+zip'
};
var _textTypes = {
@ -205,6 +207,9 @@ Zotero.MIME = new function(){
case 'audio/x-aiff':
case 'sound/aiff':
return 'aiff';
case 'application/epub+zip':
return 'epub';
}
try {

BIN
test/tests/data/stub.epub Normal file

Binary file not shown.

View file

@ -18,5 +18,9 @@ describe("Zotero.MIME", function () {
it("should detect SQLite database", async function () {
await test('test.sqlite', 'application/x-sqlite3');
});
it("should detect EPUB ebook", async function () {
await test('stub.epub', 'application/epub+zip');
});
});
});