Skip to content

Commit

Permalink
Add support for Microsoft Excel template with macros (.xltm)
Browse files Browse the repository at this point in the history
  • Loading branch information
sly7-7 committed Dec 27, 2024
1 parent f978619 commit b875a8d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ function getFileTypeFromMimeType(mimeType) {
ext: 'xlsx',
mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
};
case 'application/vnd.ms-excel.template.macroEnabled':
return {
ext: 'xltm',
mime: 'application/vnd.ms-excel.template.macroenabled.12',
};
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
return {
ext: 'docx',
Expand Down
Binary file added fixture/fixture.xltm
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@
"apk",
"drc",
"lz4",
"potx"
"potx",
"xltm"
],
"dependencies": {
"@tokenizer/inflate": "^0.2.6",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
- [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack
- [`xcf`](https://en.wikipedia.org/wiki/XCF_(file_format)) - eXperimental Computing Facility
- [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Excel document
- [`xltm`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Excel macro-enabled template
- [`xm`](https://wiki.openmpt.org/Manual:_Module_formats#The_FastTracker_2_format_.28.xm.29) - Audio module format: FastTracker 2
- [`xml`](https://en.wikipedia.org/wiki/XML) - eXtensible Markup Language
- [`xpi`](https://en.wikipedia.org/wiki/XPInstall) - XPInstall file
Expand Down
5 changes: 5 additions & 0 deletions supported.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ export const extensions = [
'apk',
'drc',
'lz4',
<<<<<<< HEAD
'potx',
=======
'xltm',
>>>>>>> 8ee3121 (Add support for XLTM)
];

export const mimeTypes = [
Expand Down Expand Up @@ -313,4 +317,5 @@ export const mimeTypes = [
'application/vnd.google.draco', // Invented by us
'application/x-lz4', // Invented by us
'application/vnd.openxmlformats-officedocument.presentationml.template',
'application/vnd.ms-excel.template.macroenabled.12',
];

0 comments on commit b875a8d

Please sign in to comment.