source: frontend/node_modules/svgo/plugins/removeXMLNS.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

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