mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Prepare root and element nodes for xast
Ref https://github.com/syntax-tree/xast - added type: root | element - renamed elem to name - replaced "elem" property checks with check for correct type
This commit is contained in:
@ -87,7 +87,7 @@ exports.fn = function (item, params) {
|
||||
params.attrs = [params.attrs];
|
||||
}
|
||||
|
||||
if (item.isElem()) {
|
||||
if (item.type === 'element') {
|
||||
var elemSeparator =
|
||||
typeof params.elemSeparator == 'string'
|
||||
? params.elemSeparator
|
||||
@ -122,7 +122,7 @@ exports.fn = function (item, params) {
|
||||
// loop patterns
|
||||
patterns.forEach(function (pattern) {
|
||||
// matches element
|
||||
if (pattern[0].test(item.elem)) {
|
||||
if (pattern[0].test(item.name)) {
|
||||
// loop attributes
|
||||
item.eachAttr(function (attr) {
|
||||
var name = attr.name;
|
||||
|
Reference in New Issue
Block a user