Skip to content

Commit c1edce4

Browse files
committed
Fix error message in addAttributesToSVGElement plugin
Ref #1352
1 parent 8d7cfa0 commit c1edce4

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

plugins/addAttributesToSVGElement.js

+32-25
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,44 @@ var ENOCLS = `Error in plugin "addAttributesToSVGElement": absent parameters.
1010
It should have a list of "attributes" or one "attribute".
1111
Config example:
1212
13-
plugins:
14-
- addAttributesToSVGElement:
15-
attribute: "mySvg"
13+
plugins: [
14+
{
15+
name: 'addAttributesToSVGElement',
16+
params: {
17+
attribute: "mySvg"
18+
}
19+
}
20+
]
1621
17-
plugins:
18-
- addAttributesToSVGElement:
19-
attributes: ["mySvg", "size-big"]
22+
plugins: [
23+
{
24+
name: 'addAttributesToSVGElement',
25+
params: {
26+
attributes: ["mySvg", "size-big"]
27+
}
28+
}
29+
]
2030
21-
plugins:
22-
- addAttributesToSVGElement:
23-
attributes:
24-
- focusable: false
25-
- data-image: icon`;
31+
plugins: [
32+
{
33+
name: 'addAttributesToSVGElement',
34+
params: {
35+
attributes: [
36+
{
37+
focusable: false
38+
},
39+
{
40+
'data-image': icon
41+
}
42+
]
43+
}
44+
}
45+
]
46+
`
2647

2748
/**
2849
* Add attributes to an outer <svg> element. Example config:
2950
*
30-
* plugins:
31-
* - addAttributesToSVGElement:
32-
* attribute: 'data-icon'
33-
*
34-
* plugins:
35-
* - addAttributesToSVGElement:
36-
* attributes: ['data-icon', 'data-disabled']
37-
*
38-
* plugins:
39-
* - addAttributesToSVGElement:
40-
* attributes:
41-
* - focusable: false
42-
* - data-image: icon
43-
*
4451
* @author April Arcus
4552
*/
4653
exports.fn = function(data, params) {

0 commit comments

Comments
 (0)