summaryrefslogtreecommitdiff
path: root/node_modules/svgo/plugins/removeStyleElement.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/svgo/plugins/removeStyleElement.js')
-rw-r--r--node_modules/svgo/plugins/removeStyleElement.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/svgo/plugins/removeStyleElement.js b/node_modules/svgo/plugins/removeStyleElement.js
new file mode 100644
index 00000000..d869a50a
--- /dev/null
+++ b/node_modules/svgo/plugins/removeStyleElement.js
@@ -0,0 +1,27 @@
+'use strict';
+
+const { detachNodeFromParent } = require('../lib/xast.js');
+
+exports.name = 'removeStyleElement';
+exports.description = 'removes <style> element (disabled by default)';
+
+/**
+ * Remove <style>.
+ *
+ * https://www.w3.org/TR/SVG11/styling.html#StyleElement
+ *
+ * @author Betsy Dupuis
+ *
+ * @type {import('./plugins-types').Plugin<'removeStyleElement'>}
+ */
+exports.fn = () => {
+ return {
+ element: {
+ enter: (node, parentNode) => {
+ if (node.name === 'style') {
+ detachNodeFromParent(node, parentNode);
+ }
+ },
+ },
+ };
+};