Skip to main content

SVGs are only rendered on GitHub if you use an <img> that points to another file

I was trying to write a Markdown file to render on GitHub, and include an SVG file.

You need to insert an <img> tag that links to the SVG elsewhere.

This works for both inline links (to files in the same repository) and external links (to files not hosted on GitHub):

<img src="./another_file_in_the_repo.svg">
<img src="https://example.net/my_great_image.svg">

![](./another_file_in_the_repo.svg)
![](https://example.net/my_great_image.svg)

What doesn’t work

Here are two approaches I tried that don’t work: