Skip to content

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