docs for export HTML
parent
4fa47ea969
commit
4ecf0dfad2
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue