Merge pull request #943 from gedion/develop

Add a hook for utils/ExportHtml.js
This commit is contained in:
John McLear 2012-08-12 08:48:10 -07:00
commit a42b2440ba
1 changed files with 17 additions and 3 deletions

View File

@ -20,7 +20,7 @@ var Changeset = require("ep_etherpad-lite/static/js/Changeset");
var padManager = require("../db/PadManager"); var padManager = require("../db/PadManager");
var ERR = require("async-stacktrace"); var ERR = require("async-stacktrace");
var Security = require('ep_etherpad-lite/static/js/security'); var Security = require('ep_etherpad-lite/static/js/security');
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
function getPadPlainText(pad, revNum) function getPadPlainText(pad, revNum)
{ {
var atext = ((revNum !== undefined) ? pad.getInternalRevisionAText(revNum) : pad.atext()); var atext = ((revNum !== undefined) ? pad.getInternalRevisionAText(revNum) : pad.atext());
@ -402,9 +402,23 @@ function getHTMLFromAtext(pad, atext)
} }
lists.length--; lists.length--;
} }
var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport",
{
line: line,
apool: apool,
attribLine: attribLines[i],
text: textLines[i]
}, " ", " ", "");
if (lineContentFromHook)
{
pieces.push(lineContentFromHook, '');
}
else
{
pieces.push(lineContent, '<br>'); pieces.push(lineContent, '<br>');
} }
} }
}
for (var k = lists.length - 1; k >= 0; k--) for (var k = lists.length - 1; k >= 0; k--)
{ {