feat(libreoffice): add more extensions according to online docs (#841)

* #840: added more extensions according to online docs @ libreoffice

* #840: align test

---------

Co-authored-by: Andrea Esposito <a.esposito@hyperborea.com>
This commit is contained in:
Andrea
2024-03-19 15:46:36 +01:00
committed by GitHub
parent b9e6a38037
commit c9aa4938f4
2 changed files with 51 additions and 2 deletions

View File

@@ -266,14 +266,25 @@ func (a *Api) Pdf(ctx context.Context, logger *zap.Logger, inputPath, outputPath
// FIXME: don't care, take all on the route level? // FIXME: don't care, take all on the route level?
func (a *Api) Extensions() []string { func (a *Api) Extensions() []string {
return []string{ return []string{
".123",
".602",
".abw",
".bib", ".bib",
".bmp", ".bmp",
".cdr",
".cgm",
".cmx",
".csv", ".csv",
".cwk",
".dbf", ".dbf",
".dif", ".dif",
".doc", ".doc",
".docm",
".docx", ".docx",
".dot",
".dotm",
".dotx", ".dotx",
".dxf",
".emf", ".emf",
".eps", ".eps",
".epub", ".epub",
@@ -281,35 +292,52 @@ func (a *Api) Extensions() []string {
".fodp", ".fodp",
".fods", ".fods",
".fodt", ".fodt",
".fopd",
".gif", ".gif",
".htm",
".html", ".html",
".hwp",
".jpeg", ".jpeg",
".jpg", ".jpg",
".key", ".key",
".ltx", ".ltx",
".lwp",
".mcw",
".met", ".met",
".mml",
".mw",
".numbers",
".odd", ".odd",
".odg", ".odg",
".odm",
".odp", ".odp",
".ods", ".ods",
".odt", ".odt",
".otg", ".otg",
".oth",
".otp",
".ots", ".ots",
".ott", ".ott",
".pages", ".pages",
".pbm", ".pbm",
".pcd",
".pct", ".pct",
".pcx",
".pdb", ".pdb",
".pdf", ".pdf",
".pgm", ".pgm",
".png", ".png",
".pot", ".pot",
".potm", ".potm",
".potx",
".ppm", ".ppm",
".pps", ".pps",
".ppt", ".ppt",
".pptm",
".pptx", ".pptx",
".psd",
".psw", ".psw",
".pub",
".pwp", ".pwp",
".pxl", ".pxl",
".ras", ".ras",
@@ -317,8 +345,11 @@ func (a *Api) Extensions() []string {
".sda", ".sda",
".sdc", ".sdc",
".sdd", ".sdd",
".sdp",
".sdw", ".sdw",
".sgl",
".slk", ".slk",
".smf",
".stc", ".stc",
".std", ".std",
".sti", ".sti",
@@ -328,25 +359,43 @@ func (a *Api) Extensions() []string {
".swf", ".swf",
".sxc", ".sxc",
".sxd", ".sxd",
".sxg",
".sxi", ".sxi",
".sxm",
".sxw", ".sxw",
".sxw", ".tga",
".tif", ".tif",
".tiff", ".tiff",
".txt", ".txt",
".uof",
".uop", ".uop",
".uos", ".uos",
".uot", ".uot",
".vdx",
".vor", ".vor",
".vsd",
".vsdm",
".vsdx",
".wb2",
".wk1",
".wks",
".wmf", ".wmf",
".wpd",
".wpg",
".wps", ".wps",
".xbm",
".xhtml", ".xhtml",
".xls", ".xls",
".xlsb",
".xlsm",
".xlsx", ".xlsx",
".xlt", ".xlt",
".xltm",
".xltx", ".xltx",
".xlw",
".xml", ".xml",
".xpm", ".xpm",
".zabw",
} }
} }

View File

@@ -450,7 +450,7 @@ func TestApi_Extensions(t *testing.T) {
extensions := a.Extensions() extensions := a.Extensions()
actual := len(extensions) actual := len(extensions)
expect := 81 expect := 130
if actual != expect { if actual != expect {
t.Errorf("expected %d extensions, but got %d", expect, actual) t.Errorf("expected %d extensions, but got %d", expect, actual)