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

Removed call to encodeSVGDatauri() from coa.js and added test case. #2053

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

Conversation

johnkenny54
Copy link
Contributor

@johnkenny54 johnkenny54 commented Aug 5, 2024

encodeSVGDatauri() is called within the optimize() function, but was being called a second time in coa.js when SVGO was run from the command line, giving a doubly-encoded, incorrect result.

This PR removes the call from coa.js and adds a test case.

Resolves #2048 resolves #997.

@GreLI
Copy link
Member

GreLI commented Aug 7, 2024

Actually, for current web browsers the only symbol needs to be escaped is “#”. Maybe it worth optimize data uri encoding…

@johnkenny54
Copy link
Contributor Author

Optimizing encodeSVGDatauri() would be a separate issue. This PR only addresses removing the duplicate call, which, as described in the related issue, completely breaks the feature from the command line.

@GreLI
Copy link
Member

GreLI commented Aug 9, 2024

True. Just noted here.

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.

Double encoding with datauri --datauri 'unenc' add 'data:image/svg+xml,data:image/svg+xml,'
2 participants