mirror of
https://github.com/svg/svgo.git
synced 2025-08-09 02:22:08 +03:00
Merge pull request #164 from silentroach/feature-remove-title
new plugin: removeTitle (disabled by default, close #159)
This commit is contained in:
22
plugins/removeTitle.js
Normal file
22
plugins/removeTitle.js
Normal 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');
|
||||
|
||||
};
|
Reference in New Issue
Block a user