vite-plugin-markdown
vite-plugin-markdown copied to clipboard
Handle relative image paths
Hi there,
It would be really useful to have relative image paths automatically resolved:

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.
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...
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!