Sha256: cd56cf7d7867d6faa44303b8cc9f8c730cc803ea128d627f051e1100b4eb21f8
Contents?: true
Size: 945 Bytes
Versions: 27
Compression:
Stored size: 945 Bytes
Contents
'use strict'; exports.type = 'perItem'; exports.active = true; exports.description = 'removes non-inheritable group’s presentational attributes'; var inheritableAttrs = require('./_collections').inheritableAttrs, attrsGroups = require('./_collections').attrsGroups, applyGroups = require('./_collections').presentationNonInheritableGroupAttrs; /** * Remove non-inheritable group's "presentation" attributes. * * @param {Object} item current iteration item * @return {Boolean} if false, item will be filtered out * * @author Kir Belevich */ exports.fn = function(item) { if (item.isElem('g')) { item.eachAttr(function(attr) { if ( ~attrsGroups.presentation.indexOf(attr.name) && !~inheritableAttrs.indexOf(attr.name) && !~applyGroups.indexOf(attr.name) ) { item.removeAttr(attr.name); } }); } };
Version data entries
27 entries across 26 versions & 9 rubygems