Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Office 365 documents: docx, pptx, xlsx #317

Merged
merged 1 commit into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ async function fromTokenizer(tokenizer) {
};
}

if (zipHeader.filename.endsWith('.rels')) {
if (zipHeader.filename.endsWith('.rels') || zipHeader.filename.endsWith('.xml')) {
const type = zipHeader.filename.split('/')[0];
switch (type) {
case '_rels':
Expand All @@ -271,7 +271,7 @@ async function fromTokenizer(tokenizer) {
mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
};
default:
return;
break;
}
}

Expand Down
Binary file added fixture/fixture-office365.docx
Binary file not shown.
Binary file added fixture/fixture-office365.pptx
Binary file not shown.
Binary file added fixture/fixture-office365.xlsx
Binary file not shown.
12 changes: 12 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ const names = {
flac: [
'fixture',
'fixture-id3v2' // FLAC prefixed with ID3v2 header
],
docx: [
'fixture',
'fixture-office365'
],
pptx: [
'fixture',
'fixture-office365'
],
xlsx: [
'fixture',
'fixture-office365'
]
};

Expand Down