Properly remove SVG attributes with SVGO (#10618)

This commit is contained in:
Álvaro Mondéjar 2024-03-13 01:11:26 +01:00 committed by GitHub
parent 0c847d8589
commit 19be66383c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,7 @@ export default {
// Sort the attributes on the <svg> tag // Sort the attributes on the <svg> tag
name: 'sortAttrs', name: 'sortAttrs',
params: { params: {
order: ['role', 'viewBox'], order: ['role', 'viewBox', 'xmlns'],
xmlnsOrder: 'end', xmlnsOrder: 'end',
}, },
}, },
@ -80,7 +80,11 @@ export default {
{ {
name: 'removeAttrs', name: 'removeAttrs',
params: { params: {
attrs: ['svg:(?!(role|viewBox|xmlns))', 'path:(?!d)', 'title:*'], attrs: [
'svg:.*(?<!((role)|(viewBox)|(xmlns)))',
'path:(?!d)',
'title:*',
],
}, },
}, },
'removeElementsByAttr', 'removeElementsByAttr',