-
Notifications
You must be signed in to change notification settings - Fork 16
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
Compact version #24
Comments
I don’t have strong feelings about this one way or another, but I realized I should probably respond at some point so it doesn’t seem like I’m being rude. Even beyond this, once evergreen browsers snuff out the last remainders of IE and the other engines that occupied the weird middle ground of “tolerates some unescaped URL characters”, |
Since I recently implemented code that records 100s of frames of SVG images to generate a GIF animation from, I double checked what I was using to urlify the SVG data, and it seems to be exactly what you suggested:
|
Modern Browsers do not require escaped < and > in DataURIs |
It's for all the other characters that need to be escaped. A custom encoder can make the result more compact, but is of course more complex code. I use a custom encoder in production. |
Since I didn't have to support IE anymore (lucky me 8 years now), I have only encoded the # , but maybe there are (URL) characters I haven't used in my SVGs |
Just wanted to leave this here in case somebody is looking for something more compact. Turned out my use case didn't include any colors matching those in here, and as that added a lot of code size, I compacted it down to the code below, which seems to work well for my use case in sudokupad.app.
This could probably minified quite a lot as it's still fairly verbosely-formatted and named.
The text was updated successfully, but these errors were encountered: