Include an SVG (hosted on GitHub) in MarkDown

后端 未结 8 1653
执笔经年
执笔经年 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:35

    I contacted GitHub to say that github.io-hosted SVGs are no longer displayed in GitHub READMEs. I received this reply:

    We have had to disable svg image rendering on GitHub.com due to potential cross site scripting vulnerabilities.

    0 讨论(0)
  • 2020-12-07 08:36

    This will work. Link to your SVG using the following pattern:

    https://cdn.rawgit.com/<repo-owner>/<repo>/<branch>/path/to.svg

    The downside is hardcoding the owner and repo in the path, meaning the svg will break if either of those are renamed.

    0 讨论(0)
提交回复
热议问题