From c9aa4938f46da9877a30302596518d3997bb6de9 Mon Sep 17 00:00:00 2001 From: Andrea <1174320+roy20021@users.noreply.github.com> Date: Tue, 19 Mar 2024 15:46:36 +0100 Subject: [PATCH] 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 --- pkg/modules/libreoffice/api/api.go | 51 ++++++++++++++++++++++++- pkg/modules/libreoffice/api/api_test.go | 2 +- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/pkg/modules/libreoffice/api/api.go b/pkg/modules/libreoffice/api/api.go index 68bd6ebf..9e899e27 100644 --- a/pkg/modules/libreoffice/api/api.go +++ b/pkg/modules/libreoffice/api/api.go @@ -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? func (a *Api) Extensions() []string { return []string{ + ".123", + ".602", + ".abw", ".bib", ".bmp", + ".cdr", + ".cgm", + ".cmx", ".csv", + ".cwk", ".dbf", ".dif", ".doc", + ".docm", ".docx", + ".dot", + ".dotm", ".dotx", + ".dxf", ".emf", ".eps", ".epub", @@ -281,35 +292,52 @@ func (a *Api) Extensions() []string { ".fodp", ".fods", ".fodt", + ".fopd", ".gif", + ".htm", ".html", + ".hwp", ".jpeg", ".jpg", ".key", ".ltx", + ".lwp", + ".mcw", ".met", + ".mml", + ".mw", + ".numbers", ".odd", ".odg", + ".odm", ".odp", ".ods", ".odt", ".otg", + ".oth", + ".otp", ".ots", ".ott", ".pages", ".pbm", + ".pcd", ".pct", + ".pcx", ".pdb", ".pdf", ".pgm", ".png", ".pot", ".potm", + ".potx", ".ppm", ".pps", ".ppt", + ".pptm", ".pptx", + ".psd", ".psw", + ".pub", ".pwp", ".pxl", ".ras", @@ -317,8 +345,11 @@ func (a *Api) Extensions() []string { ".sda", ".sdc", ".sdd", + ".sdp", ".sdw", + ".sgl", ".slk", + ".smf", ".stc", ".std", ".sti", @@ -328,25 +359,43 @@ func (a *Api) Extensions() []string { ".swf", ".sxc", ".sxd", + ".sxg", ".sxi", + ".sxm", ".sxw", - ".sxw", + ".tga", ".tif", ".tiff", ".txt", + ".uof", ".uop", ".uos", ".uot", + ".vdx", ".vor", + ".vsd", + ".vsdm", + ".vsdx", + ".wb2", + ".wk1", + ".wks", ".wmf", + ".wpd", + ".wpg", ".wps", + ".xbm", ".xhtml", ".xls", + ".xlsb", + ".xlsm", ".xlsx", ".xlt", + ".xltm", ".xltx", + ".xlw", ".xml", ".xpm", + ".zabw", } } diff --git a/pkg/modules/libreoffice/api/api_test.go b/pkg/modules/libreoffice/api/api_test.go index 3ebc45e6..eed96f97 100644 --- a/pkg/modules/libreoffice/api/api_test.go +++ b/pkg/modules/libreoffice/api/api_test.go @@ -450,7 +450,7 @@ func TestApi_Extensions(t *testing.T) { extensions := a.Extensions() actual := len(extensions) - expect := 81 + expect := 130 if actual != expect { t.Errorf("expected %d extensions, but got %d", expect, actual)