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

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

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


当前回答

我有一个解决办法:

a)互联网示例:

![image info e.g. Alt](URL Internet to Images.jpg "Image Description")

b)本地图像示例:

![image Info](file:///<Path to your File><image>.jpg "Image Description")
![image Info](file:///C:/Users/<name>/Pictures/<image>.jpg "Image Description")

涡轮字节

其他回答

添加一个本地图像对我来说是这样的:![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://前缀的情况下工作。真是一团糟。

据我所知,对于Linux上的VSCode,只有当您将映像放入与.md post文件相同的文件夹中时,本地映像才能正常显示。 即只有! [](image.jpg)或![](。/ image.jpg)将工作。 甚至像![](/home/bala/image.jpg)这样的绝对路径也不能工作。

这对我来说在ubuntu中很有效:

![Image](/home/gps/Pictures/test.png "a title")

降价文件在:

/home/gps/Documents/Markdown/

图片文件在:

/home/gps/Pictures/

你可能会发现下面的语法类似于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

编辑:

为我工作(本地形象)

![system schema](doc/systemDiagram.jpg)

 tree
 ├── doc
     └── jobsSystemSchema.jpg
 ├── README.md

markdown文件README。Md与doc目录处于同一级别。

在您的情况下,您的降价文件应该与目录文件处于同一级别。

为我工作(带原始路径的绝对url)

![system schema](https://server/group/jobs/raw/master/doc/systemDiagram.jpg)

不为我工作(url与blob路径)

![system schema](https://server/group/jobs/blob/master/doc/systemDiagram.jpg)