vite-plugin-markdown icon indicating copy to clipboard operation
vite-plugin-markdown copied to clipboard

Handle relative image paths

Open davestewart opened this issue 3 years ago • 2 comments

Hi there,

It would be really useful to have relative image paths automatically resolved:

![image](./image.png)

I see the lib uses MarkdownIt; perhaps a plugin exists, or could be written?

I'm happy to take input, research and potentially PR this.

davestewart avatar Sep 23 '22 11:09 davestewart

In the meantime, adding something to the docs on the recommended way to handle images would be great.

I think for now probably the best option is to put images in the public folder and refer to them with an absolute URL (but removing /public/. This is obviously not ideal though...

theoephraim avatar Mar 24 '23 02:03 theoephraim

I am using the plugin within an Electron environment and thus have different absolute image path during development and after deploy. I would be fine with replacing image src on-the-fly before or after loading the markdown as Vue component. I was experimenting with the markdown option of the plugin, yet, it seems to replace the entire markdown rendering process? Anyway, handling relative image path properly would be a huge plus!

raphaelmenges avatar Jun 30 '23 12:06 raphaelmenges