【问题标题】:Image won't show up on NPM, but shows up on Github图片不会出现在 NPM 上,但会出现在 Github 上
【发布时间】:2016-07-31 23:22:51
【问题描述】:

为 NPM 模块处理这个 repo

图片显示在 Github 上(向下滚动)

https://github.com/ORESoftware/suman

但在 NPM 上,尽管使用 HTTP 200 从 Github 检索图像,但它没有显示

https://www.npmjs.com/package/suman

这都是Markdown,图片的markdown是:

![alt text](https://github.com/ORESoftware/suman/blob/master/images/suman.png "Suman Primary Logo")

有人知道为什么这个 Markdown 图像标签在 NPM 上不起作用吗?

【问题讨论】:

    标签: node.js github npm markdown


    【解决方案1】:

    使用此网址 (https://raw.githubusercontent.com/ORESoftware/suman/master/images/suman.png)

    您的网址链接到页面而不是图片

    【讨论】:

      【解决方案2】:

      这是因为网址

      https://github.com/mvsowndapan/react-dnd-crop/blob/master/asset/icons/labelIcon.png
      

      请求包含图像的 github 页面,而不是图像本身。

      要获取图片,只需在网址末尾添加?raw=true

      https://github.com/mvsowndapan/react-dnd-crop/blob/master/asset/icons/labelIcon.png?raw=true
      

      像这样。效果很好

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-11-21
        • 2017-06-25
        • 2013-01-26
        • 1970-01-01
        • 2013-09-01
        • 2018-02-19
        • 2016-10-02
        • 1970-01-01
        相关资源
        最近更新 更多