Accepting Arrays on 'exportHtmlAdditionalTags' to handle attributes stored as ['key', 'value'] (and not only ['key', 'true'])

This commit is contained in:
Luiza Pagliari 2015-08-24 07:58:45 -07:00
parent 7170a6a8cb
commit 1a5985dc75
2 changed files with 30 additions and 3 deletions

View file

@ -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 `<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