图片不会出现在 NPM 上,但会出现在 Github
Image won't show up on NPM, but shows up on Github
正在处理 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 上不起作用吗?
使用这个 url (https://raw.githubusercontent.com/ORESoftware/suman/master/images/suman.png)
您的 url link 页面不是图片
这是因为 url
https://github.com/mvsowndapan/react-dnd-crop/blob/master/asset/icons/labelIcon.png
请求包含图像的 github 页面,而不是图像本身。
要获取图像,只需在 url
末尾添加 ?raw=true
https://github.com/mvsowndapan/react-dnd-crop/blob/master/asset/icons/labelIcon.png?raw=true
像这样。效果很好
正在处理 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 上不起作用吗?
使用这个 url (https://raw.githubusercontent.com/ORESoftware/suman/master/images/suman.png)
您的 url link 页面不是图片
这是因为 url
https://github.com/mvsowndapan/react-dnd-crop/blob/master/asset/icons/labelIcon.png
请求包含图像的 github 页面,而不是图像本身。
要获取图像,只需在 url
末尾添加?raw=true
https://github.com/mvsowndapan/react-dnd-crop/blob/master/asset/icons/labelIcon.png?raw=true
像这样。效果很好