preview-inline
preview-inline copied to clipboard
Doesn't get image path/ fail to parse
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.
I just gave the solution to the problem.