diff options
author | Luiza Pagliari <lpagliari@gmail.com> | 2015-08-24 07:58:45 -0700 |
---|---|---|
committer | Luiza Pagliari <lpagliari@gmail.com> | 2015-08-24 07:58:45 -0700 |
commit | 1a5985dc759c33e614eaa53ba9c4d2489c9e3495 (patch) | |
tree | c94981e08214ac1825aae71bfaa0c3c4e1d0a50d /doc/api | |
parent | 7170a6a8cb9d3a8f186ebbe8782c3ab2782b4dee (diff) | |
download | etherpad-lite-1a5985dc759c33e614eaa53ba9c4d2489c9e3495.zip |
Accepting Arrays on 'exportHtmlAdditionalTags' to handle attributes stored as ['key', 'value'] (and not only ['key', 'true'])
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/hooks_server-side.md | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/api/hooks_server-side.md b/doc/api/hooks_server-side.md index 79879b2f..4f441f58 100644 --- a/doc/api/hooks_server-side.md +++ b/doc/api/hooks_server-side.md @@ -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 |