Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
29
Frontend-Learner/node_modules/svgo/plugins/removeEmptyAttrs.js
generated
vendored
Normal file
29
Frontend-Learner/node_modules/svgo/plugins/removeEmptyAttrs.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { attrsGroups } from './_collections.js';
|
||||
|
||||
export const name = 'removeEmptyAttrs';
|
||||
export const description = 'removes empty attributes';
|
||||
|
||||
/**
|
||||
* Remove attributes with empty values.
|
||||
*
|
||||
* @author Kir Belevich
|
||||
*
|
||||
* @type {import('../lib/types.js').Plugin}
|
||||
*/
|
||||
export const fn = () => {
|
||||
return {
|
||||
element: {
|
||||
enter: (node) => {
|
||||
for (const [name, value] of Object.entries(node.attributes)) {
|
||||
if (
|
||||
value === '' &&
|
||||
// empty conditional processing attributes prevents elements from rendering
|
||||
!attrsGroups.conditionalProcessing.has(name)
|
||||
) {
|
||||
delete node.attributes[name];
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue