Skip to content

Commit

Permalink
Add support for Microsoft Word template (.dotx)
Browse files Browse the repository at this point in the history
  • Loading branch information
sly7-7 committed Dec 30, 2024
1 parent 0dab3e0 commit a590080
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ function getFileTypeFromMimeType(mimeType) {
ext: 'docx',
mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
};
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.template':
return {
ext: 'dotx',
mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
};
case 'application/vnd.openxmlformats-officedocument.presentationml.template':
return {
ext: 'potx',
Expand Down
Binary file added fixture/fixture.dotx
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@
"drc",
"lz4",
"potx",
"xltx"
"xltx",
"dotx"
],
"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 @@ -453,6 +453,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream.
- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image
- [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file
- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word document
- [`dotx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Word template
- [`drc`](https://en.wikipedia.org/wiki/Zstandard) - Google's Draco 3D Data Compression
- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
- [`dwg`](https://en.wikipedia.org/wiki/.dwg) - Autodesk CAD file
Expand Down
2 changes: 2 additions & 0 deletions supported.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const extensions = [
'lz4',
'potx',
'xltx',
'dotx',
];

export const mimeTypes = [
Expand Down Expand Up @@ -315,4 +316,5 @@ export const mimeTypes = [
'application/x-lz4', // Invented by us
'application/vnd.openxmlformats-officedocument.presentationml.template',
'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
];

0 comments on commit a590080

Please sign in to comment.