Not compatible in srcset attribute
See original GitHub issueIn the gatsby-image project, we’ve discovered in a PR being reviewed that SVG data URIs from this library are not compatible with the srcset attribute.
Only base64 or url-encoded work. The only notable difference from the example given, was literal spaces vs %20. In the srcset attribute, you provide a comma delimited list of URL/URIs and an optional space followed by a descriptor(eg 1x, 100w), if none provided they’ll use a default.
With the output from mini-svg-data-uri a console error is raised, and the srcset is ignored.
It might be worth mentioning on your README that mini-svg-data-uri will not work for this use-case? Or at least requires another pass to convert the spaces to %20, or this library provides some config/option to handle that?(it looks like you intentionally convert to literal spaces?)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (6 by maintainers)

Top Related StackOverflow Question
Should be up on npm as v1.1.3. Thank you for your patience and help!
Whoops, I completely goofed. I’ll publish a new version tonight.