microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.71k stars 29.08k forks source link

VSCode doesn't display Markdown images in Jupyter Notebook #154813

Closed JuanCab closed 2 years ago

JuanCab commented 2 years ago

Issue Type: Bug

Loaded a Jupyter notebook from https://github.com/lukepolson/youtube_channel/blob/main/Python%20Tutorial%20Series/image_processing1.ipynb

(also downloaded associated '../Data/CT_scan.npy' and '../images/HU.png').

There is a Markdown cell (I believe it is #5 from the top) that displays the HU.PNG image inline. This works on the 'jupyter lab' command line running in Chrome, but doesn't display properly in VSCode (I instead get a broken image link icon with the alternative text displayed).

I also tried the direct Markdown code of

![Table of typical HU Values](../images/HU.png)

and that renders perfectly in Jupyterlab running on Chrome, but not in VSCode.

VS Code version: Code 1.69.0 (Universal) (92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9, 2022-07-07T05:28:41.511Z) OS version: Darwin arm64 21.5.0 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|10, 9, 9| |Memory (System)|16.00GB (0.10GB free)| |Process Argv|--crash-reporter-id e7f6bfec-c4a0-49d2-98c4-5b5c48019475| |Screen Reader|no| |VM|0%|
Extensions (26) Extension|Author (truncated)|Version ---|---|--- code-gnu-global|aus|0.2.2 vscode-open-in-typora|cyb|1.2.0 vscode-mac-color-picker|dae|1.0.2 vscode-markdownlint|Dav|0.47.0 vscode-dash|dee|2.4.0 gitlens|eam|12.1.1 theme-macos-classic|hua|1.4.2 latex-workshop|Jam|8.27.2 vscode-ksdiff|kal|1.0.0 vsc-python-indent|Kev|1.17.0 rainbow-csv|mec|2.4.0 python|ms-|2022.10.0 vscode-pylance|ms-|2022.7.20 jupyter|ms-|2022.6.1001902341 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.8 cpptools|ms-|1.10.8 autodocstring|njp|0.6.1 printcode|nob|3.0.0 indent-rainbow|ode|8.3.1 vscode-css-peek|pra|4.2.0 code-settings-sync|Sha|3.4.3 python|tht|0.2.3 vscodeintellicode|Vis|1.2.22 change-case|wma|1.0.0 material-theme|zhu|3.15.2 (10 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 vsclangdf:30486550 ```
mjbvz commented 2 years ago

Works fine for me when you open that project as a workspace:

Screen Shot 2022-07-11 at 11 14 34 PM

If you just open the single file (without opening any workspace) we don't allow the image to be accessed for security reasons since it uses .. to travers up to a parent folder

JuanCab commented 2 years ago

That makes sense, I so rarely open notebooks directly instead of in a workspace I didn't catch it. Thanks!