We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
i'm using a modified encode function in my project for month now grabbed from this very nice post without any problems:
https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
Function is in this comment: https://codepen.io/tigt/post/optimizing-svgs-in-data-uris#comment-id-6931 It's feels more safe because it uses encodeURIComponent first and replaces just some characters back.
As an addition to it, I also strip the XML declaration if present after processing with something like:
svgCode.replace(/<\?xml[^>]*>/g, '');
What about using those as a default encode function?
The text was updated successfully, but these errors were encountered:
It's probably good solution, but our current solution works good as well. I don't think we need to change implementation without good reasons.
As an addition to it, I also strip the XML declaration if present after processing with something like
It's a job for SVGO. Either run it on source SVGs, or as a PostCSS plugin. This plugin does inlining only.
Sorry, something went wrong.
No branches or pull requests
Hi,
i'm using a modified encode function in my project for month now grabbed from this very nice post without any problems:
https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
Function is in this comment: https://codepen.io/tigt/post/optimizing-svgs-in-data-uris#comment-id-6931 It's feels more safe because it uses encodeURIComponent first and replaces just some characters back.
As an addition to it, I also strip the XML declaration if present after processing with something like:
svgCode.replace(/<\?xml[^>]*>/g, '');
What about using those as a default encode function?
The text was updated successfully, but these errors were encountered: