aboutsummaryrefslogtreecommitdiff
path: root/node_modules/svgo/plugins/removeRasterImages.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/svgo/plugins/removeRasterImages.js')
-rw-r--r--node_modules/svgo/plugins/removeRasterImages.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/node_modules/svgo/plugins/removeRasterImages.js b/node_modules/svgo/plugins/removeRasterImages.js
new file mode 100644
index 00000000..cbddebe3
--- /dev/null
+++ b/node_modules/svgo/plugins/removeRasterImages.js
@@ -0,0 +1,28 @@
+'use strict';
+
+exports.type = 'perItem';
+
+exports.active = false;
+
+exports.description = 'removes raster images (disabled by default)';
+
+/**
+ * Remove raster images references in <image>.
+ *
+ * @see https://bugs.webkit.org/show_bug.cgi?id=63548
+ *
+ * @param {Object} item current iteration item
+ * @return {Boolean} if false, item will be filtered out
+ *
+ * @author Kir Belevich
+ */
+exports.fn = function(item) {
+
+ if (
+ item.isElem('image') &&
+ item.hasAttrLocal('href', /(\.|image\/)(jpg|png|gif)/)
+ ) {
+ return false;
+ }
+
+};