source: trip-planner-front/node_modules/svgo/plugins/removeComments.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 634 bytes
Line 
1'use strict';
2
3const { detachNodeFromParent } = require('../lib/xast.js');
4
5exports.name = 'removeComments';
6exports.type = 'visitor';
7exports.active = true;
8exports.description = 'removes comments';
9
10/**
11 * Remove comments.
12 *
13 * @example
14 * <!-- Generator: Adobe Illustrator 15.0.0, SVG Export
15 * Plug-In . SVG Version: 6.00 Build 0) -->
16 *
17 * @author Kir Belevich
18 *
19 * @type {import('../lib/types').Plugin<void>}
20 */
21exports.fn = () => {
22 return {
23 comment: {
24 enter: (node, parentNode) => {
25 if (node.value.charAt(0) !== '!') {
26 detachNodeFromParent(node, parentNode);
27 }
28 },
29 },
30 };
31};
Note: See TracBrowser for help on using the repository browser.