HTML export: Move `padId` to context object property
parent
f6aed0c9cb
commit
68a91f5e24
|
@ -668,15 +668,15 @@ Things in context:
|
||||||
|
|
||||||
1. padId
|
1. padId
|
||||||
|
|
||||||
This hook will allow a plug-in developer to include additional HTML content in the Body of the exported HTML
|
This hook will allow a plug-in developer to include additional HTML content in
|
||||||
|
the body of the exported HTML.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
```
|
|
||||||
exports.exportHTMLAdditionalContent = async (hookName, context) => {
|
|
||||||
let padId = context;
|
|
||||||
return "I am groot in " + padId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
```
|
||||||
|
exports.exportHTMLAdditionalContent = async (hookName, {padId}) => {
|
||||||
|
return 'I am groot in ' + padId;
|
||||||
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
## stylesForExport
|
## stylesForExport
|
||||||
|
|
|
@ -498,10 +498,9 @@ exports.getPadHTMLDocument = async function (padId, revNum)
|
||||||
|
|
||||||
let html = await getPadHTML(pad, revNum);
|
let html = await getPadHTML(pad, revNum);
|
||||||
|
|
||||||
let exportHTMLAdditionalContent = await hooks.aCallAll("exportHTMLAdditionalContent", padId);
|
for (const hookHtml of await hooks.aCallAll("exportHTMLAdditionalContent", {padId}) {
|
||||||
exportHTMLAdditionalContent.forEach(function(hookHtml){
|
|
||||||
html += hookHtml;
|
html += hookHtml;
|
||||||
});
|
}
|
||||||
|
|
||||||
return eejs.require("ep_etherpad-lite/templates/export_html.html", {
|
return eejs.require("ep_etherpad-lite/templates/export_html.html", {
|
||||||
body: html,
|
body: html,
|
||||||
|
|
Loading…
Reference in New Issue