Does removeAttrs support regular expression patterns for attribute matching?
0 reputation · 27 May 2020, 20:10 UTC
Understanding removeAttrs Pattern Matching
The svgo removeAttrs plugin allows users to specify attributes for removal via the removeAttrs configuration option. While the documentation notes that users can provide attribute names or patterns, it does not explicitly state whether these patterns are treated as literal strings, support regular expression syntax, or observe case‑sensitivity rules.
Additionally, when multiple patterns are supplied, the precedence rules for overlapping or conflicting entries are not documented, nor is it clear whether users can define exclusion patterns to protect certain attributes from removal.
Open Questions
- Does the
removeAttrsoption accept regular expression patterns, and if so, what syntax and flags are supported? - When several patterns match the same attribute, which pattern determines the outcome—does the last defined pattern win, or is specificity considered?
- Can users specify negation or exclusion patterns to keep specific attributes despite a broader removal rule?