microsoft / vscode

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

Markdown links break when link label includes stylization #119501

Closed greazer closed 3 years ago

greazer commented 3 years ago

@rsonger commented on Fri Mar 19 2021

Environment data

Expected behaviour

When adding stylization to a link label within a markdown cell (for example, [_label_](https://www.github.com)), rendering the cell should also render the stylization of the text while maintaining full link functionality. This type of behavior is observed in common markdown editors, markdown preview extensions for VS Code (such as Markdown Preview Enhanced), even the markdown editor here on GitHub.

Actual behaviour

When the entire link label text within the square brackets of the label is stylized (emphasis or strong emphasis in particular), then the link still renders as clickable but clicking on the rendered link does not respond in any way.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Open a Jupyter Notebook in VS Code and create a new markdown cell.
  2. Inside the cell, put the following code:
    [test1](https://www.github.com)
    [__test2__](https://www.github.com)
    __[test3](https://www.github.com)__
    [__this__ is __test4__](https://www.github.com)
  3. Run the cell and click on "test2". Note that it does not open the link whereas "test1, "test3" and "this is test4" all work without issue.

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

``` > ~/anaconda3/envs/datascienv/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2021.3.619093157/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" Error 2021-03-19 17:57:40: Jupyter Kernel Spec not found for a local connection > ~/anaconda3/envs/datascienv/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2021.3.619093157/pythonFiles/pyvsc-run-isolated.py pip list > ~/anaconda3/envs/datascienv/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2021.3.619093157/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > ~/anaconda3/envs/datascienv/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2021.3.619093157/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v Started kernel Python 3.7.10 64-bit ('datascienv': conda) > ~/anaconda3/envs/datascienv/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2021.3.619093157/pythonFiles/pyvsc-run-isolated.py -c "import ipykernel" > ~/anaconda3/envs/datascienv/bin/python ~/.vscode/extensions/ms-toolsai.jupyter-2021.3.619093157/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v ```


@claudiaregio commented on Sat Mar 20 2021

Thanks @rsonger I am able to reproduce this behavior at this time

rebornix commented 3 years ago

@greazer thanks for forwarding the issue.

@mjbvz I didn't reproduce this issue with the custom markdown renderer. I wonder if we want to support this in the builtin markdown as well. It looks like a bug to me.

mjbvz commented 3 years ago

With VS Code insiders, I can't reproduce this with the built-in markdown renderer using GitHub issues and Jupyter. @rebornix Were you able to reproduce the issue?

mjbvz commented 3 years ago

I believe this is an issue with custom editor based Jupyter notebooks. It should be filed against the python/jupyter extension instead

mjbvz commented 3 years ago

I'm going to close this as it does not seem like a VS Code issue

rsonger commented 3 years ago

Yes, this bug occurs specifically in the Jupyter notebook that comes with Microsoft's Python extension. That's why I originally filed it under the vscode-jupyter extension mentioned by @greazer above.