1
0
mirror of https://github.com/svg/svgo.git synced 2025-08-07 15:22:54 +03:00

Merge pull request #164 from silentroach/feature-remove-title

new plugin: removeTitle (disabled by default, close #159)
This commit is contained in:
Kir Belevich
2014-01-08 09:35:25 -08:00
2 changed files with 32 additions and 0 deletions

22
plugins/removeTitle.js Normal file
View File

@@ -0,0 +1,22 @@
'use strict';
exports.type = 'perItem';
exports.active = false;
/**
* Remove <title>.
* Disabled by default cause it may be used for accessibility.
*
* https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title
*
* @param {Object} item current iteration item
* @return {Boolean} if false, item will be filtered out
*
* @author Igor Kalashnikov
*/
exports.fn = function(item) {
return !item.isElem('title');
};

View File

@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg">
<title>...</title>
<g/>
</svg>
@@@
<svg xmlns="http://www.w3.org/2000/svg">
<g/>
</svg>

After

Width:  |  Height:  |  Size: 143 B