mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
go!
This commit is contained in:
24
plugins/removeEmptyContainers.js
Normal file
24
plugins/removeEmptyContainers.js
Normal file
@ -0,0 +1,24 @@
|
||||
var container = require('./_collections').elems.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
|
||||
* @param {Object} params plugin params
|
||||
* @return {Boolean} if false, item will be filtered out
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*/
|
||||
exports.removeEmptyContainers = function(item, params) {
|
||||
|
||||
return !(item.isElem(container) && item.isEmpty());
|
||||
|
||||
};
|
Reference in New Issue
Block a user