docs for export HTML

pull/2488/head
John McLear 2015-01-24 02:24:10 +00:00
parent 4fa47ea969
commit 4ecf0dfad2
1 changed files with 24 additions and 0 deletions

View File

@ -247,6 +247,30 @@ Things in context:
This hook will allow a plug-in developer to re-write each line when exporting to HTML.
Example:
```
var Changeset = require("ep_etherpad-lite/static/js/Changeset");
exports.getLineHTMLForExport = function (hook, context) {
var header = _analyzeLine(context.attribLine, context.apool);
if (header) {
return "<" + header + ">" + context.lineContents + "</" + header + ">";
}
}
function _analyzeLine(alineAttrs, apool) {
var header = null;
if (alineAttrs) {
var opIter = Changeset.opIterator(alineAttrs);
if (opIter.hasNext()) {
var op = opIter.next();
header = Changeset.opAttributeValue(op, 'heading', apool);
}
}
return header;
}
```
## stylesForExport
Called from: src/node/utils/ExportHtml.js