svg / svgo

⚙️ Node.js tool for optimizing SVG files
https://svgo.dev/
MIT License
21.03k stars 1.39k forks source link

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

Open johnkenny54 opened 3 months ago

johnkenny54 commented 3 months ago

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 commented 3 months ago

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

johnkenny54 commented 3 months ago

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 commented 3 months ago

True. Just noted here.