From 6d38b056230feda140fd150170af17a861352fde Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 6 May 2014 17:32:45 +0100 Subject: [PATCH 1/2] abiword shouldnt be used for HTML native documents --- src/node/handler/ImportHandler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index f58076bb..467def3b 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -114,7 +114,10 @@ exports.doImport = function(req, res, padId) //convert file to html function(callback) { if(!importHandledByPlugin){ - if (abiword) { + var fileEnding = path.extname(srcFile).toLowerCase(); + var fileIsHTML = (fileEnding === ".html" || fileEnding === ".htm"); + if (abiword && !fileIsHTML) { + console.warn("Using abiword"); abiword.convertFile(srcFile, destFile, "htm", function(err) { //catch convert errors if(err) { From b74c43889e2d12c79ad9a8028b58e76f3ce074da Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 9 May 2014 13:50:00 +0100 Subject: [PATCH 2/2] Update ImportHandler.js --- src/node/handler/ImportHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 467def3b..c2e46d1c 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -117,7 +117,6 @@ exports.doImport = function(req, res, padId) var fileEnding = path.extname(srcFile).toLowerCase(); var fileIsHTML = (fileEnding === ".html" || fileEnding === ".htm"); if (abiword && !fileIsHTML) { - console.warn("Using abiword"); abiword.convertFile(srcFile, destFile, "htm", function(err) { //catch convert errors if(err) {