From 4bea3a348ea833915dc5b0d228a282119b20c027 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sat, 21 Sep 2013 23:29:32 +0100 Subject: [PATCH] strip title out of html during import, pesky abiword behavior --- src/node/handler/ImportHandler.js | 5 ++++- src/node/utils/Abiword.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 281a8d7bf..d6b15eaf6 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -151,7 +151,10 @@ exports.doImport = function(req, res, padId) fs.readFile(destFile, "utf8", function(err, _text){ if(ERR(err, callback)) return; text = _text; - + // Title needs to be stripped out else it appends it to the pad.. + text = text.replace("", "<!-- <title>"); + text = text.replace("-->"); + //node on windows has a delay on releasing of the file lock. //We add a 100ms delay to work around this if(os.type().indexOf("Windows") > -1){ diff --git a/src/node/utils/Abiword.js b/src/node/utils/Abiword.js index 498583c9d..2ef4f444c 100644 --- a/src/node/utils/Abiword.js +++ b/src/node/utils/Abiword.js @@ -100,7 +100,7 @@ else { //add data to buffer stdoutBuffer+=data.toString(); - + //we're searching for the prompt, cause this means everything we need is in the buffer if(stdoutBuffer.search("AbiWord:>") != -1) {