You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The svg helper function calls encodeURIComponent on the provided SVG before returning it. Based on the comment above the return line, that appears to be intentional as a fix for some different issue. Encoding the data like this completely breaks the data URI, resulting in a missing image placeholder on both Shreddit and the Android app (iOS untested).
If the point of the URI encoding is to avoid issues with special characters, perhaps it would be best to instead encode it as a base64 string? From testing with local modifications, changing the return line to this appears to work as far as the SVG actually showing up is concerned:
The
svg
helper function callsencodeURIComponent
on the provided SVG before returning it. Based on the comment above the return line, that appears to be intentional as a fix for some different issue. Encoding the data like this completely breaks the data URI, resulting in a missing image placeholder on both Shreddit and the Android app (iOS untested).devvit/packages/public-api/src/apis/ui/helpers/svg.ts
Lines 51 to 53 in 1ac06fd
If the point of the URI encoding is to avoid issues with special characters, perhaps it would be best to instead encode it as a base64 string? From testing with local modifications, changing the return line to this appears to work as far as the SVG actually showing up is concerned:
The text was updated successfully, but these errors were encountered: