From 12c05c20b284e53dac4603c075e0fedfe4358de6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 30 Aug 2020 14:11:12 +0100 Subject: [PATCH] bugfix/import: doc import bugfix (#4235) --- src/node/utils/LibreOffice.js | 4 +++- tests/backend/specs/api/importexportGetPost.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/utils/LibreOffice.js b/src/node/utils/LibreOffice.js index 12a98fa48..dfbee8fa5 100644 --- a/src/node/utils/LibreOffice.js +++ b/src/node/utils/LibreOffice.js @@ -43,7 +43,9 @@ exports.convertFile = function(srcFile, destFile, type, callback) { if (type === "html") { // "html:XHTML Writer File:UTF8" does a better job than normal html exports - type = "html:XHTML Writer File:UTF8"; + if (path.extname(srcFile).toLowerCase() === ".doc") { + type = "html"; + } // PDF files need to be converted with LO Draw ref https://github.com/ether/etherpad-lite/issues/4151 if (path.extname(srcFile).toLowerCase() === ".pdf") { type = "html:XHTML Draw File" diff --git a/tests/backend/specs/api/importexportGetPost.js b/tests/backend/specs/api/importexportGetPost.js index e4e07639a..f678f7de7 100644 --- a/tests/backend/specs/api/importexportGetPost.js +++ b/tests/backend/specs/api/importexportGetPost.js @@ -110,7 +110,7 @@ describe('Imports and Exports', function(){ // For some reason word import does not work in testing.. // TODO: fix support for .doc files.. - xit('Tries to import .doc that uses soffice or abiword', function(done) { + it('Tries to import .doc that uses soffice or abiword', function(done) { if(!settings.allowAnyoneToImport) return done(); if((settings.abiword && settings.abiword.indexOf("/" === -1)) && (settings.office && settings.soffice.indexOf("/" === -1))) return done();