Sha256: 052d64ba593f66cb8f6a7e8330ffe2db6e4ddfcc33dccee63dcc2d6c8f3949d1

Contents?: true

Size: 690 Bytes

Versions: 34

Compression:

Stored size: 690 Bytes

Contents

'use strict';

exports.type = 'perItemReverse';

exports.active = true;

exports.description = 'removes empty container elements';

var container = require('./_collections').elemsGroups.container;

/**
 * Remove empty containers.
 *
 * @see http://www.w3.org/TR/SVG/intro.html#TermContainerElement
 *
 * @example
 * <defs/>
 *
 * @example
 * <g><marker><a/></marker></g>
 *
 * @param {Object} item current iteration item
 * @return {Boolean} if false, item will be filtered out
 *
 * @author Kir Belevich
 */
exports.fn = function(item) {

    return !(item.isElem(container) && !item.isElem('svg') && item.isEmpty() &&
        (!item.isElem('pattern') || !item.hasAttrLocal('href')));

};

Version data entries

34 entries across 31 versions & 11 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.18.0 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.18.2 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.16.1 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.15.2 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.18.4 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.18.1 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.14.0 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
tang-0.2.1 spec/tang_app/node_modules/svgo/plugins/removeEmptyContainers.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/svgo/plugins/removeEmptyContainers.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/svgo/plugins/removeEmptyContainers.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/svgo/plugins/removeEmptyContainers.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/svgo/plugins/removeEmptyContainers.js
tang-0.2.0 spec/tang_app/node_modules/svgo/plugins/removeEmptyContainers.js
tang-0.1.0 spec/tang_app/node_modules/svgo/plugins/removeEmptyContainers.js
tang-0.0.9 spec/tang_app/node_modules/svgo/plugins/removeEmptyContainers.js
enju_library-0.3.8 spec/dummy/node_modules/svgo/plugins/removeEmptyContainers.js
jester-data-8.0.0 node_modules/svgo/plugins/removeEmptyContainers.js