mirror of
https://github.com/svg/svgo.git
synced 2025-04-19 10:22:15 +03:00
26 lines
530 B
JavaScript
26 lines
530 B
JavaScript
import { detachNodeFromParent } from '../lib/xast.js';
|
|
|
|
export const name = 'removeMetadata';
|
|
export const description = 'removes <metadata>';
|
|
|
|
/**
|
|
* Remove <metadata>.
|
|
*
|
|
* https://www.w3.org/TR/SVG11/metadata.html
|
|
*
|
|
* @author Kir Belevich
|
|
*
|
|
* @type {import('./plugins-types.js').Plugin<'removeMetadata'>}
|
|
*/
|
|
export const fn = () => {
|
|
return {
|
|
element: {
|
|
enter: (node, parentNode) => {
|
|
if (node.name === 'metadata') {
|
|
detachNodeFromParent(node, parentNode);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
};
|