Some markdown parsers support absolute paths like (/path/to/image.png). The root folder denotes to the root of the project. Example:
https://github.com/kachkaev/linter-markdown-51/blob/master/README.md
These absolute references are useful in cases when an online markdown viewer does not support relative URLs with ../. From my experience, ../path/to/image.png does not work in gitlab. Absolute links are also handy when you move the files around the repository – you do not have to edit them each time. Bulk finding and replacing /path/to/image.png is also easier than trying to find all relative links to it: path/to/image.png, to/image.png, ../../to/image.png, etc.
It would be nice if markdown-preview-enhanced knew about absolute paths and could show the images that are embedded in such a way.
Hi @kachkaev , sorry for my late reply
Absolute image path is now supported.
Markdown file link also supports absolute path.
For example [test.md](/docs/test.md) now works
Please upgrade to the newest version, then restart atom
Cheers ;)
Hi @shd101wyy , when export to HTML, the relative path (e.g.images/image.png ) will be converted to absolute path instead of using relative path, it makes the html file cannot find correct image path once the html file is moved.
I will fix it later. Thanks!
Hi @ckdanny , it should work now.
Please upgrade the package ;)
Sorry for the trouble.
Looks like there is one tiny issue left with absolute paths, which is quite easy to reproduce.
If there is more than one project in a list on the left, absolute paths to images inside .md only work for the first one of them. Changing the order of the projects affects the result of the preview. Looks like this is to do with how the package resolves the paths.
Interestingly, it is possible to refer to an image in one project from another one. E.g.:
img-a.png
project-b
img-b.png
README.md
README.md:
 ← works, but should not
 ← does not work, but should
Ok i see. I only considered one project when implementing absolute path. I will fix this issue this weekend.
Thanks
Hi @kachkaev , should be fixed now ;) Thanks
It worked, thank you @shd101wyy!
It seems this feature has some problems working with project-manager. Since I would switch between multi projects, markdown-preview-enhanced sometimes uses root path of project B when I'm editing a file in project A.
It worked !!! Wow!!!
Most helpful comment
Ok i see. I only considered one project when implementing absolute path. I will fix this issue this weekend.
Thanks