2018-08-16 11:33:32 +02:00
|
|
|
module.exports = {
|
|
|
|
rules: {
|
|
|
|
elm: {
|
|
|
|
"svg": 1,
|
|
|
|
"svg > title": 1,
|
|
|
|
"g": false,
|
|
|
|
},
|
|
|
|
attr: [
|
|
|
|
{ // ensure that the SVG elm has the appropriate attrs
|
|
|
|
"role": "img",
|
|
|
|
"viewBox": "0 0 24 24",
|
|
|
|
"xmlns": "http://www.w3.org/2000/svg",
|
2018-11-06 18:10:17 +02:00
|
|
|
|
2018-08-16 11:33:32 +02:00
|
|
|
"rule::selector": "svg",
|
|
|
|
"rule::whitelist": true,
|
|
|
|
},
|
|
|
|
{ // ensure that the title elm has the appropriate attr
|
|
|
|
"rule::selector": "svg > title",
|
|
|
|
"rule::whitelist": true,
|
2019-03-20 09:55:03 +02:00
|
|
|
},
|
|
|
|
{ // ensure that the path element only has the 'd' attr (no style, opacity, etc.)
|
|
|
|
"d": /^[,a-zA-Z0-9\. -]+$/,
|
|
|
|
"rule::selector": "svg > path",
|
|
|
|
"rule::whitelist": true,
|
2018-08-16 11:33:32 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|