Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup improvements #41

Merged
merged 4 commits into from
Jul 24, 2014
Merged

Cleanup improvements #41

merged 4 commits into from
Jul 24, 2014

Conversation

Frank3K
Copy link
Contributor

@Frank3K Frank3K commented Jun 28, 2014

Added option 'cleanupdefs' (default: false); when set to false no cleanup is done on elements inside the <defs> element. This can be useful when one does not want to remove style-attributes for elements inside <defs> elements. For example, on usingdef.svg (blob/master/test/fixtures/usingdef.svg) one may not want to remove the style attribute (style="stop-color:rgb(255,255,0);stop-opacity:1") which sets the style for the linearGradient. For reasons mentioned in #37, one may want to remove all other style attributes.

Changed option 'cleanup'; it now accepts an array of attributes. For backwards compatibility cleanup === true equals ['style']. The attributes in the array are removed from all elements. This can be useful for example when one want to set the fill of a drawing using CSS.

Frank3K added 4 commits June 28, 2014 18:49
…object-based approach using cheerio.

This change is for better readability and maintainability of the code and does not noticeably impact the speed of the task.
…d mapped to uniqued IDs. Unreferenced IDs are removed in order to save space.
…nup is done on elements inside the <defs> element.

Changed option 'cleanup'; it now accepts an array of attributes. For backwards compatibility cleanup === true equals ['style']. The attributes in the array are removed from all elements.
@FWeinb FWeinb mentioned this pull request Jul 1, 2014
@FWeinb FWeinb merged commit d0a4c39 into FWeinb:master Jul 24, 2014
@Frank3K Frank3K deleted the cleanup-change-1 branch July 26, 2014 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants