-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Maybe use https://github.com/WebReflection/linkedom for
Lines 69 to 88 in 1def07e
| svg = svg.replace( | |
| 'fill="#000000" stroke="none"', | |
| `fill="rgb(${r},${g},${b})" stroke="rgb(${r},${g},${b})"${ | |
| a === '255' | |
| ? '' | |
| : ` fill-opacity="${alpha}" stroke-opacity="${alpha}"` | |
| } stroke-width="${params.strokeWidth}px"`, | |
| ); | |
| const pathRegEx = /<path\s*d="([^"]+)"\/>/g; | |
| let matches; | |
| const shortPaths = []; | |
| while ((matches = pathRegEx.exec(svg)) !== null) { | |
| const path = matches[1]; | |
| if (path.split(' ').length < params.minPathSegments) { | |
| shortPaths.push(matches[0]); | |
| } | |
| } | |
| shortPaths.forEach((path) => { | |
| svg = svg.replace(path, ''); | |
| }); |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request