Include an SVG (hosted on GitHub) in MarkDown

后端 未结 8 1794
执笔经年
执笔经年 2020-12-07 07:49

I know with that an image can be placed in a MD with the MD syntax of either ![Alt text](/path/to/img.jpg) or ![Alt text](/path/to/img.jpg "Optional

8条回答
  •  臣服心动
    2020-12-07 08:32

    I have a working example with an img-tag, but your images won't display. The difference I see is the content-type.

    I checked the github image from your post (the google doc images don't load at all because of connection failures). The image from github is delivered as content-type: text/plain, which won't get rendered as an image by your browser.

    The correct content-type value for svg is image/svg+xml. So you have to make sure that svg files set the correct mime type, but that's a server issue.

    Try it with http://svg.tutorial.aptico.de/grafik_svg/dummy3.svg and don't forget to specify width and height in the tag.

提交回复
热议问题