mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Merge pull request #2762 from storytouch/exportTagsAsArrays
Accepting Arrays on 'exportHtmlAdditionalTags'
This commit is contained in:
commit
504cc102a0
2 changed files with 37 additions and 4 deletions
|
@ -357,7 +357,7 @@ Things in context:
|
|||
|
||||
1. Pad object
|
||||
|
||||
This hook will allow a plug-in developer to include more properties and attributes to support during HTML Export. An Array should be returned.
|
||||
This hook will allow a plug-in developer to include more properties and attributes to support during HTML Export. An Array should be returned. If a value in this array is a string, the exported HTML will contain tags like `<tag_name>` for the content where attributes are `['tag_name', 'true']`; if a value in this array is a pair `['tag_name', 'value']`, the exported HTML will contain tags like `<span data-tag_name="value">` for the content where attributes are `['tag_name', 'value']`.
|
||||
|
||||
Example:
|
||||
```
|
||||
|
@ -368,6 +368,15 @@ exports.exportHtmlAdditionalTags = function(hook, pad, cb){
|
|||
};
|
||||
```
|
||||
|
||||
Example when attributes are stores as `['color', 'red']` on the attribute pool:
|
||||
```
|
||||
// Add the props to be supported in export
|
||||
exports.exportHtmlAdditionalTags = function(hook, pad, cb){
|
||||
var padId = pad.id;
|
||||
cb([["color", "red"], ["color", "blue"]]);
|
||||
};
|
||||
```
|
||||
|
||||
## userLeave
|
||||
Called from src/node/handler/PadMessageHandler.js
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue