iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.36k stars 268 forks source link

Feature: Interpret absolute image links relative to `g:mkdp_images_path` #651

Open helins opened 3 months ago

helins commented 3 months ago

Some common workflows interpret absolute links relative to a well-known directory rather than the actual root of the filesystem, akin to how a web server interpret absolute links relative to the domain. I don't think there is currently a way for this plugin to behave like that regarding images.

I would suggest an additional boolean option for interpreting absolute image links relative to the existing g:mkdp_images_path (if provided). For instance, if g:mkdp_images_path is set to /foo/bar, then an image like ![](/baz.png) would resolve to /foo/bar/baz.png.

This should be an easy add-on and would turn this plugin from "great" to "excellent" :)