mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00
Make the aceAttribClasses hook harder to misuse
This commit is contained in:
parent
5aa318a09b
commit
ba6bdf35be
2 changed files with 13 additions and 9 deletions
|
@ -679,18 +679,21 @@ exports.stylesForExport = function(hook, padId, cb){
|
|||
## aceAttribClasses
|
||||
Called from: src/static/js/linestylefilter.js
|
||||
|
||||
Things in context:
|
||||
1. Attributes - Object of Attributes
|
||||
This hook is called when attributes are investigated on a line. It is useful if
|
||||
you want to add another attribute type or property type to a pad.
|
||||
|
||||
This hook is called when attributes are investigated on a line. It is useful if you want to add another attribute type or property type to a pad.
|
||||
An attributes object is passed to the aceAttribClasses hook functions instead of
|
||||
the usual context object. A hook function can either modify this object directly
|
||||
or provide an object whose properties will be assigned to the attributes object.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
exports.aceAttribClasses = function(hook_name, attr, cb){
|
||||
attr.sub = 'tag:sub';
|
||||
cb(attr);
|
||||
}
|
||||
exports.aceAttribClasses = (hookName, attrs, cb) => {
|
||||
return cb([{
|
||||
sub: 'tag:sub',
|
||||
}]);
|
||||
};
|
||||
```
|
||||
|
||||
## exportFileName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue