vscode-markdown-pdf icon indicating copy to clipboard operation
vscode-markdown-pdf copied to clipboard

Feature: support local image

Open ahuigo opened this issue 7 years ago • 5 comments

I found it does not support local image:

![local_image](/img/test.png)

ahuigo avatar Jun 12 '18 13:06 ahuigo

It does, but I think you need to remove the first /. Try with ![local_image](img/test.png) and it should work.

SolenLeRoux avatar Jun 13 '18 20:06 SolenLeRoux

I think it's reasonable to support image with / prefixed path(which basePath is ${projectRoot}).

  1. By default, vscode markdown preview could load such a image path: ![local_image](/img/test.png).
  2. My blog's markdown use such image path too.

Could you support it?

ahuigo avatar Jun 14 '18 03:06 ahuigo

It doesn't make much sense to remote the forward slash, that will break the preview and also as @ahuigo said it will break the blog markdown path.

I think the problem is that this plugin does not support local files at all, I tried removing the forward slash and same outcome.

TheFern2 avatar Aug 15 '19 01:08 TheFern2

Take a look at #141 it might help you. I was able to preview correctly on vscode, print to pdf, and view correctly on github. The thing to watch out is the path in relation to the md file.

TheFern2 avatar Aug 15 '19 23:08 TheFern2

I'm favor of the request from ahuigo. / prefixed path is accepted by Markdown Preview. It's useful to allow moving md files in the directory tree leaving the image file path unchanged.

kfukuiclaudio avatar Nov 08 '22 22:11 kfukuiclaudio