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

Code blocks in Markdown render poorly #212988

Closed
fonnesbeck opened this issue May 16, 2024 · 4 comments
Closed

Code blocks in Markdown render poorly #212988

fonnesbeck opened this issue May 16, 2024 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@fonnesbeck
Copy link

fonnesbeck commented May 16, 2024

Environment data

  • VS Code version: 1.89.1
  • Jupyter Extension version (available under the Extensions sidebar): v2024.3.1
  • Python Extension version (available under the Extensions sidebar): v2024.4.1
  • OS (Windows | Mac | Linux distro) and version: Fedora 40
  • Python and/or Anaconda version: 3.11
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

When a code block (here, Python) is added to a markdown cell using triple quotes, the block is formatted as code with appropriate language coloration when specified. Here is a working example in a browser-based Jupyter notebook:

image

Actual behaviour

In VSCode, the block is not well defined and does not include language coloration despite the language being specified with the code block. It looks really terrible, almost as if inline code formatting is being used on the block. If this is the case, it is not the correct encoding.

Note that this is independent of which theme is being used in VSCode. They all look similar to this, but using the dominant colors of the theme being used.

image

Steps to reproduce:

Create a code block inside of a markdown cell using the triple quote notation (and language label, optionally)

@fonnesbeck fonnesbeck added the bug Issue identified by VS Code Team member as probable bug label May 16, 2024
@DonJayamanne DonJayamanne assigned amunger and unassigned DonJayamanne May 17, 2024
@amunger amunger transferred this issue from microsoft/vscode-jupyter May 17, 2024
@mjbvz
Copy link
Contributor

mjbvz commented May 17, 2024

Please share an example notebook file too

@fonnesbeck
Copy link
Author

fonnesbeck commented May 18, 2024

This occurs with any notebook containing markdown code blocks, but here is a simple example.

Here is what this code looks like in VSCode, using two different themes:

image

image

@mjbvz
Copy link
Contributor

mjbvz commented May 20, 2024

Thanks. Looks fine to me tho:

Image

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

@fonnesbeck
Copy link
Author

Thank you. It looks like a Markdown preview extension was causing this. Sorry for the trouble!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants