source: trip-planner-front/node_modules/svgo/plugins/removeXMLNS.js@ eed0bf8

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

initial commit

  • Property mode set to 100644
File size: 623 bytes
RevLine 
[6a3a178]1'use strict';
2
3exports.name = 'removeXMLNS';
4
5exports.type = 'perItem';
6
7exports.active = false;
8
9exports.description =
10 'removes xmlns attribute (for inline svg, disabled by default)';
11
12/**
13 * Remove the xmlns attribute when present.
14 *
15 * @example
16 * <svg viewBox="0 0 100 50" xmlns="http://www.w3.org/2000/svg">
17 * ↓
18 * <svg viewBox="0 0 100 50">
19 *
20 * @param {Object} item current iteration item
21 * @return {Boolean} if true, xmlns will be filtered out
22 *
23 * @author Ricardo Tomasi
24 */
25exports.fn = function (item) {
26 if (item.type === 'element' && item.name === 'svg') {
27 delete item.attributes.xmlns;
28 }
29};
Note: See TracBrowser for help on using the repository browser.