mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
Add plugin types (#1527)
Covered following plugins - addAttributesToSVGElement.js - addClassesToSVGElement.js - cleanupAttrs.js - convertEllipseToCircle.js - removeAttributesBySelector.js - removeAttrs.js - removeComments.js - removeDesc.js - removeDoctype.js - removeElementsByAttr.js - removeEmptyText.js - removeMetadata.js - removeRasterImages.js - removeScriptElement.js - removeStyleElement.js - removeTitle.js - removeXMLProcInst.js
This commit is contained in:
@ -11,14 +11,16 @@ exports.description = 'converts non-eccentric <ellipse>s to <circle>s';
|
||||
* @see https://www.w3.org/TR/SVG11/shapes.html
|
||||
*
|
||||
* @author Taylor Hunt
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<void>}
|
||||
*/
|
||||
exports.fn = () => {
|
||||
return {
|
||||
element: {
|
||||
enter: (node) => {
|
||||
if (node.name === 'ellipse') {
|
||||
const rx = node.attributes.rx || 0;
|
||||
const ry = node.attributes.ry || 0;
|
||||
const rx = node.attributes.rx || '0';
|
||||
const ry = node.attributes.ry || '0';
|
||||
if (
|
||||
rx === ry ||
|
||||
rx === 'auto' ||
|
||||
|
Reference in New Issue
Block a user