github svg根本没有渲染

时间:2017-09-23 15:51:52

标签: svg github

我正在尝试在github中创建一个markdown文件,并希望在其中放入一个svg图像。 github根本不渲染图像。我使用<img />![]()进行了尝试。根本就不行!有人见过这个吗?

刚刚修改了存储库,以便公开:https://github.com/michelucci/deepbook

先谢谢,翁贝托

3 个答案:

答案 0 :(得分:0)

GitHub的降价似乎阻止了SVG文件,但您始终可以使用裸HTML标记:

<img src="neuron_fig1.svg"/>

答案 1 :(得分:0)

有关任何内联HTML的信息,请参阅issue 458,但由于这不是您的问题,因此您可以将your pagethis one进行比较:它会显示很多svg图片及其{{} 3}}

"source": [
    "## Python Objects\n",
    "\n",
    "We begin with a look at a Python object. In Python, objects are stored in memory blocks independently allocated on the heap. A single floating point value looks something like this:\n",
    "\n",
    "![Python Float](fig/python_float.svg)\n",
    "\n",
    "This doesn’t look too bad, in a dynamically typed system we need to store some metadata about the type, and we need to store the data containing the value."
   ]
  },

所以相对URL(到source is here)确实有效。

您的代码:

   "source": [
    " ![](neuron_fig1.svg) \n",
    " **Fig. 1** The structure of a neuron. $x_i$ are the input, $w_i$ are the weights."
   ]

答案 2 :(得分:0)

似乎GitHub现在需要在SVG字符串末尾使用http查询参数sanitize=true。如果要从Wiki链接到存储库中的图像,则URL的末尾可能已经有参数。因此,如果没有查询参数,请添加?sanitize=true,否则请添加&sanitize=true

<img alt="my image" src="https://raw.githubusercontent.com/user/branch/images/myimage.svg?example=foo&sanitize=true>