From 17357bee2a0be21b119edc52f1882843d688ab45 Mon Sep 17 00:00:00 2001 From: Sylvain Mina Date: Tue, 24 Dec 2024 16:55:41 +0100 Subject: [PATCH] Add support for Microsoft Excel template with macros (.xltm) --- core.js | 5 +++++ fixture/fixture.xltm | Bin 0 -> 8861 bytes package.json | 3 ++- readme.md | 1 + supported.js | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 fixture/fixture.xltm diff --git a/core.js b/core.js index 10b596af..a529b0c0 100644 --- a/core.js +++ b/core.js @@ -59,6 +59,11 @@ function getFileTypeFromMimeType(mimeType) { ext: 'xltx', mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', }; + 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', diff --git a/fixture/fixture.xltm b/fixture/fixture.xltm new file mode 100644 index 0000000000000000000000000000000000000000..807c4a076b57258c5bb9b42af2b086b98d8b26bc GIT binary patch literal 8861 zcmeHN1y>x)x*goz-Q5Z9?yf%q*2p$LyLEa?yo_EgS zo%ajw?OCg9O;_)4O;7Dz->&*vLm37Z7XS}H1ONb3fM&6jS2j=pfDJ4FfCE5;Hj;LB za)#Q^wT#IWc9g6z-(A*rIdlB@lU! zphvOW87VfFlj+NWr>%7NKJ`Fovplmx!tP)>0jMP|||5P5GTP z>*JT~ABMSAW^8Rggd{lvmb~12o@F~io5?MqE9;fw=7vh>hNKSr0pt@$!l}RI*DutHRrRGQH7)o6< zE~AGFW~;CtXh>AyO9Z-~n6hBkIV3=%`&i<8MY(2vr=h{V@DQftzUese8s4mU z-btbjNb-DPjP0D8Auxjv{$zCCNj5(5z3S{P%uI%yKwei~Kf5pnEi4zWO9ptI??$2s ztGm^B*Pj~g*4SgGrS)~&J8=d%AcR|wk1zm@zX^1UJPIBfBG7G!{!kzS1-e=}fH>HH zo&PJ$|6n!#<<$Pz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json +++ b/package.json @@ -221,7 +221,8 @@ "drc", "lz4", "potx", - "xltx" + "xltx", + "xltm" ], "dependencies": { "@tokenizer/inflate": "^0.2.6", diff --git a/readme.md b/readme.md index c25c6966..18417fe9 100644 --- a/readme.md +++ b/readme.md @@ -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 - [`xltx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Excel 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 diff --git a/supported.js b/supported.js index 59c27e16..a5ee38e0 100644 --- a/supported.js +++ b/supported.js @@ -158,6 +158,7 @@ export const extensions = [ 'lz4', 'potx', 'xltx', + 'xltm', ]; export const mimeTypes = [ @@ -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.ms-excel.template.macroenabled.12', ];