有人知道如何在markdown显示本地图像吗?我不想为此设置网络服务器。

我尝试以下markdown,但它不起作用:

![](文件/ \用户形象/ jzhang桌面/孤立。png)


当前回答

只需从markdown文件中添加相对图像文件路由

![localImage](./client/src/assets/12.png)

其他回答

你可能会发现下面的语法类似于markdown中的引用链接,特别是当你有一个文本有许多相同的图像显示时:

![optional text description of the image][number]

[number]: URL

例如:


![][1]

![This is an optional description][2]




[1]: /home/jerzy/ComputerScience/Parole/Screenshot_2020-10-13_11-53-29.png
[2]: /home/jerzy/ComputerScience/Parole/Screenshot_2020-10-13_11-53-30.png

我怀疑这条路不对。正如user7412219所提到的,ubuntu和windows处理路径不同。试着把图片和你的笔记本放在同一个文件夹中,并使用:

![alt text](Isolated.png "Title")

在windows上,桌面应该在:C:\Users\jzhang\Desktop

另一种不显示本地图像的可能性是无意缩进图像引用空格![alt text](文件)之前。

这使得它成为“代码块”而不是“图像包含”。只要去掉前面的空格。

添加一个本地图像对我来说是这样的:![alt文本](文件://IMG_20181123_115829.jpg)

没有文件://前缀,它不能工作(Win10, notepad++与MarkdownViewer++插件)

编辑:我发现它也适用于html标签,这是更好的方式: <img src="file://IMG_20181123_115829.jpg" alt="alt text" width="200"/> .jpg

Edit2:在Atom编辑器中,它只在没有file://前缀的情况下工作。真是一团糟。

只需从markdown文件中添加相对图像文件路由

![localImage](./client/src/assets/12.png)