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

Ignore malformed style attributes in minifyStyles. #2054

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

johnkenny54
Copy link
Contributor

If a style attribute contains malformed styles, csso.minifyBlock() may throw an exception. This PR changes the code to catch the exception and leave the style value unchanged.

Resolves #1863.

@GreLI
Copy link
Member

GreLI commented Aug 7, 2024

Maybe add an option to remove malformed style? Users may want to have garbage styles removed. But it's not clear if the styles wrong or just some new feature not recognized by SVGO, so it should be optional.

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.

TypeError: Cannot read properties of undefined (reading '0')
2 participants