preview-inline icon indicating copy to clipboard operation
preview-inline copied to clipboard

Doesn't get image path/ fail to parse

Open jtakesp opened this issue 5 years ago • 1 comments

I just struggled with an issue and want to share: If you add the image-link into a markdown-file with "%20" instead of spaces as some tools do, e.g. "" you will get a problem with inline-preview. In the function image-marker.js->parseImageLocation the path will be recognized as not absolute and the basepath and the markdown-link will be merged, which is great. However, if you set the basePath e.g. "C:Users/one user name/" the function getImagePath cannot resolve a combination of spaces and "%20". the exception just sets the local image path instead of adding the basePath at the beginning. As a result, if the basePath is modified in the settings, it just will be ignored.

Solution: add "imagePath = imagePath.replace(/%20/g," ");" in the function image-marker.js->parseImageLocation.

jtakesp avatar Oct 03 '19 14:10 jtakesp

I just gave the solution to the problem.

jtakesp avatar Oct 03 '19 14:10 jtakesp