diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 836165b16..f2e275eea 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; @@ -490,112 +491,17 @@ 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' + - '' + Security.escapeHTML(padId) + '\n' + - '\n' + - '\n' + - '\n' + - '\n' + - '\n' + '\n') + - ''; - var foot = '\n\n'; getPadHTML(pad, revNum, function (err, html) { if(ERR(err, callback)) return; - callback(null, head + html + foot); + var exportedDoc = eejs.require("ep_etherpad-lite/templates/export_html.html", { + body: html, + doctype: noDocType ? '' : '', + padId: Security.escapeHTML(padId), + extraCSS: stylesForExportCSS + }); + callback(null, exportedDoc); }); }); }); diff --git a/src/templates/export_html.html b/src/templates/export_html.html new file mode 100644 index 000000000..24e83ac2c --- /dev/null +++ b/src/templates/export_html.html @@ -0,0 +1,143 @@ +<%- doctype %> + + +<%- padId %> + + + + + + + +<%- body %> + +