diff --git a/src/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js index 8f91ced23..fe7ab3db1 100644 --- a/src/node/handler/ExportHandler.js +++ b/src/node/handler/ExportHandler.js @@ -76,7 +76,7 @@ exports.doExport = function(req, res, padId, type) } else if(type == "txt") { - exporttxt.getPadTXTDocument(padId, req.params.rev, false, function(err, txt) + exporttxt.getPadTXTDocument(padId, req.params.rev, function(err, txt) { if(ERR(err)) return; res.send(txt); @@ -92,7 +92,7 @@ exports.doExport = function(req, res, padId, type) //render the html document function(callback) { - exporthtml.getPadHTMLDocument(padId, req.params.rev, false, function(err, _html) + exporthtml.getPadHTMLDocument(padId, req.params.rev, function(err, _html) { if(ERR(err, callback)) return; html = _html; diff --git a/src/node/hooks/express/padreadonly.js b/src/node/hooks/express/padreadonly.js index 66be33390..bff8adf7b 100644 --- a/src/node/hooks/express/padreadonly.js +++ b/src/node/hooks/express/padreadonly.js @@ -7,7 +7,7 @@ var exporthtml = require("../../utils/ExportHtml"); exports.expressCreateServer = function (hook_name, args, cb) { //serve read only pad args.app.get('/ro/:id', function(req, res) - { + { var html; var padId; @@ -40,7 +40,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { hasPadAccess(req, res, function() { //render the html document - exporthtml.getPadHTMLDocument(padId, null, false, function(err, _html) + exporthtml.getPadHTMLDocument(padId, null, function(err, _html) { if(ERR(err, callback)) return; html = _html; diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 836165b16..bd177ac47 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -22,6 +22,7 @@ var ERR = require("async-stacktrace"); var _ = require('underscore'); var Security = require('ep_etherpad-lite/static/js/security'); var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); +var eejs = require('ep_etherpad-lite/node/eejs'); var _analyzeLine = require('./ExportHelper')._analyzeLine; var _encodeWhitespace = require('./ExportHelper')._encodeWhitespace; @@ -478,7 +479,7 @@ function getHTMLFromAtext(pad, atext, authorColors) return pieces.join(''); } -exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) +exports.getPadHTMLDocument = function (padId, revNum, callback) { padManager.getPad(padId, function (err, pad) { @@ -490,112 +491,16 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) stylesForExport.forEach(function(css){ stylesForExportCSS += css; }); - // Core inclusion of head etc. - var head = - (noDocType ? '' : '\n') + - '\n' + (noDocType ? '' : '
\n' + - '