Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown preview cannot display images outside current directory on Linux #64685

Closed
liolok opened this issue Dec 9, 2018 · 1 comment
Closed
Assignees
Labels
*as-designed Described behavior is as designed markdown Markdown support issues

Comments

@liolok
Copy link

liolok commented Dec 9, 2018

Versions

  • VSCode Version: 1.29.1
  • OS Version:
    • Arch Linux
    • A fresh installed elementary OS Juno 5.0 on VMware (based on Ubuntu 18.04 LTS, should be regarded as the same Linux distro in this issue)

Steps to Reproduce

  1. Open a markdown file for example /path/to/this/file.md, which is in directory /path/to/this/;
  2. Add a local image which is wherever outside /path/to/this/, for example /path/to/that/image.png (or ../that/image.png to current directory /path/to/this/);
  3. Open preview of this markdown file, image just won't show up.

Screenshots

Markdown and image files' location relationship is displayed on the left half of this screenshot.

elementary os-2018-12-09-12-08-13

screenshot from 2018-12-09 12-20-14

Extensions

Does this issue occur when all extensions are disabled?: Yes, and extension "Markdown Preview Enhanced" has the same issue.

More info I want to submit

This issue occurs on both Arch Linux and elementary OS: On Arch I tried community/code, archlinuxcn/visual-studio-code-bin and aur/visual-studio-code-insiders; on elementary OS I just followed the documentation Running Visual Studio Code on Linux and ran the command $ sudo apt install ./code_1.29.1-1542309157_amd64.deb.

I've also changed "Preview Security Settings" and even disabled it, still the same.

Once before I used the ../docs/image.png link on VSCode for Windows and the behavior was expected, so it seems to be an issue on VSCode for Linux for now.

@vscodebot vscodebot bot assigned mjbvz Dec 9, 2018
@vscodebot vscodebot bot added the markdown Markdown support issues label Dec 9, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Dec 12, 2018

This is by design. Even if you disable markdown security settings, we only allow the preview to load data from inside the current workspace. This helps to somewhat lessen the impact of opening with untrusted content with security settings disabled

@mjbvz mjbvz closed this as completed Dec 12, 2018
@mjbvz mjbvz added the *as-designed Described behavior is as designed label Dec 12, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed markdown Markdown support issues
Projects
None yet
Development

No branches or pull requests

2 participants