Im writing a plugin for etherpad. I am implementing the padUpdate
hook and would like to know the contents of the pad.
This is my handler in the index.js of the plugin:
exports.padUpdate = function (hook_name, context) {
// get text of pad
const text = ...;
processText(text);
};
Documentation says: Things in context:
- pad - the pad instance
- author - the id of the author who updated the pad
- revs - the index of the new revision
- changeset - the changeset of this revision (see Changeset Library)
And there is a function getText(padID, [rev])
. My first idea was to get the pad ID from context and call getText(padID)
, but I don't know on which object to call getText(padID)
.
Found it: