include the callback call, for sanity and stop the pad from being nuked so early in the function

This commit is contained in:
John McLear 2013-02-12 23:38:02 +00:00
parent 086132de66
commit e152c477c7
2 changed files with 4 additions and 5 deletions

View File

@ -270,7 +270,7 @@ exports.setHTML = function(padID, html, callback)
if(ERR(err, callback)) return;
// add a new changeset with the new html to the pad
importHtml.setPadHTML(pad, cleanText(html));
importHtml.setPadHTML(pad, cleanText(html), callback);
//update the clients on the pad
padMessageHandler.updatePadClients(pad, callback);

View File

@ -25,10 +25,6 @@ function setPadHTML(pad, html, callback)
{
var apiLogger = log4js.getLogger("ImportHtml");
// Clean the pad. This makes the rest of the code easier
// by several orders of magnitude.
pad.setText("");
var padText = pad.text();
// Parse the incoming HTML with jsdom
var doc = jsdom(html.replace(/>\n+</g, '><'));
apiLogger.debug('html:');
@ -44,6 +40,8 @@ function setPadHTML(pad, html, callback)
return; // We don't process the HTML because it was bad..
}
// console.warn("LUL WUT THE FUCK U DOIN HERE?");
var result = cc.finish();
apiLogger.debug('Lines:');
@ -90,6 +88,7 @@ function setPadHTML(pad, html, callback)
// the changeset is ready!
var theChangeset = builder.toString();
apiLogger.debug('The changeset: ' + theChangeset);
pad.setText("");
pad.appendRevision(theChangeset);
}