schnee effeckt und fehler Korektur
This commit is contained in:
24
node_modules/svgo/plugins/removeXMLProcInst.js
generated
vendored
24
node_modules/svgo/plugins/removeXMLProcInst.js
generated
vendored
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
exports.type = 'perItem';
|
||||
const { detachNodeFromParent } = require('../lib/xast.js');
|
||||
|
||||
exports.name = 'removeXMLProcInst';
|
||||
exports.type = 'visitor';
|
||||
exports.active = true;
|
||||
|
||||
exports.description = 'removes XML processing instructions';
|
||||
|
||||
/**
|
||||
@@ -12,13 +13,18 @@ exports.description = 'removes XML processing instructions';
|
||||
* @example
|
||||
* <?xml version="1.0" encoding="utf-8"?>
|
||||
*
|
||||
* @param {Object} item current iteration item
|
||||
* @return {Boolean} if false, item will be filtered out
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<void>}
|
||||
*/
|
||||
exports.fn = function(item) {
|
||||
|
||||
return !(item.processinginstruction && item.processinginstruction.name === 'xml');
|
||||
|
||||
exports.fn = () => {
|
||||
return {
|
||||
instruction: {
|
||||
enter: (node, parentNode) => {
|
||||
if (node.name === 'xml') {
|
||||
detachNodeFromParent(node, parentNode);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user