diff options
Diffstat (limited to 'node_modules/svgo/plugins/removeTitle.js')
| -rw-r--r-- | node_modules/svgo/plugins/removeTitle.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/svgo/plugins/removeTitle.js b/node_modules/svgo/plugins/removeTitle.js new file mode 100644 index 00000000..ee136cd5 --- /dev/null +++ b/node_modules/svgo/plugins/removeTitle.js @@ -0,0 +1,27 @@ +'use strict'; + +const { detachNodeFromParent } = require('../lib/xast.js'); + +exports.name = 'removeTitle'; +exports.description = 'removes <title>'; + +/** + * Remove <title>. + * + * https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title + * + * @author Igor Kalashnikov + * + * @type {import('./plugins-types').Plugin<'removeTitle'>} + */ +exports.fn = () => { + return { + element: { + enter: (node, parentNode) => { + if (node.name === 'title') { + detachNodeFromParent(node, parentNode); + } + }, + }, + }; +}; |
