Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
I was investigating issues I've seen displaying some images (most often in instance/community sidebars). It turns out that a common culprit is SVG files, which
ExtendedImage
cannot render.This PR adds the ability to check whether an image is an SVG (getting only the headers, so the http request is lightweight), and if so, using a different widget to render the SVG (from jovial_svg) in markdown. This works in post bodies, comment bodies, and sidebars. It doesn't affect when a post link references an SVG. Like the web, that is still treated as an external link. It also doesn't allow SVGs to be tapped and opened in an image viewer.
I also enhanced the error messaging for when images legitimately don't load.
Issue Being Fixed
Inability to render SVGs.
Screenshots / Recordings
Before
svg-before.mp4
After
svg-after.mp4
Checklist
semanticLabel
s where applicable for accessibility?