From d5faefdeaef04811c7f6059c413c816e5f8b2d49 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Sat, 9 Jun 2012 10:53:51 -0400 Subject: [PATCH 1/3] Bugfix to setPadHTML. resolves #764 --- src/node/utils/ImportHtml.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 4b50b0326..5c6bb634e 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -50,9 +50,7 @@ function setPadHTML(pad, html, callback) } // Get the new plain text and its attributes - var newText = map(result.lines, function (e) { - return e + '\n'; - }).join(''); + var newText = result.lines.join('\n'); apiLogger.debug('newText:'); apiLogger.debug(newText); var newAttribs = result.lineAttribs.join('|1+1') + '|1+1'; From 486f7c904e08f1a524335afe44372fc056f2a0f6 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Mon, 11 Jun 2012 23:33:17 -0400 Subject: [PATCH 2/3] Bugfix to setHTML - it was ignoring the last letter of each line. fixes issue #768 --- src/node/utils/ImportHtml.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 5c6bb634e..7c638fb8c 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -20,7 +20,6 @@ var log4js = require('log4js'); var Changeset = require("ep_etherpad-lite/static/js/Changeset"); var contentcollector = require("ep_etherpad-lite/static/js/contentcollector"); -var map = require("ep_etherpad-lite/static/js/ace2_common").map; function setPadHTML(pad, html, callback) { @@ -60,7 +59,7 @@ function setPadHTML(pad, html, callback) var attribsIter = Changeset.opIterator(attribs); var textIndex = 0; var newTextStart = 0; - var newTextEnd = newText.length - 1; + var newTextEnd = newText.length; while (attribsIter.hasNext()) { var op = attribsIter.next(); From 23075138b9ffb643cda3c1842dcbd4fb737ed373 Mon Sep 17 00:00:00 2001 From: Jordan Hollinger Date: Tue, 12 Jun 2012 11:03:09 -0400 Subject: [PATCH 3/3] Lock down npm version to avaoid bug in later version --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index c46abbbf6..48750fbcb 100644 --- a/src/package.json +++ b/src/package.json @@ -25,7 +25,7 @@ "log4js" : "0.4.1", "jsdom-nocontextifiy" : "0.2.10", "async-stacktrace" : "0.0.2", - "npm" : "1.1", + "npm" : "1.1.24", "ejs" : "0.6.1", "graceful-fs" : "1.1.5", "slide" : "1.1.3",