yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.93k stars 325 forks source link

Preview of unsaved file fails to load images with relative paths #1477

Open sparr opened 3 weeks ago

sparr commented 3 weeks ago

What's the problem

I created a new file, set the type to Markdown, and added an image tag like ![alt text](file.png). Then I opened the markdown preview, and the image showed as a broken link icon.

What's the expected result

The image should be loaded from the directory the file would be saved to by default; the directory what was selected when the new file was created.

How to reproduce

  1. file > new
  2. ![alt text](relative/path/to/some/image.png)
  3. Markdown Open Preview

Other information