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's code highlight, math and Mermaid support are broken in VS Code #446

Closed
Chaoses-Ib opened this issue Jan 5, 2024 · 1 comment · Fixed by #480
Closed

Markdown's code highlight, math and Mermaid support are broken in VS Code #446

Chaoses-Ib opened this issue Jan 5, 2024 · 1 comment · Fixed by #480

Comments

@Chaoses-Ib
Copy link
Contributor

import solara

@solara.component
def Page():
    solara.Markdown(r'''
# Large
## Smaller

## List items

* item 1
* item 2

## Math
Also, $x^2$ is rendered as math.

Or multiline math:
$$
\int_0^1 x^2 dx = \frac{1}{3}
$$

## Code highlight support
```python
code = "formatted" and "supports highlighting"
```


## Mermaid support!
See [Mermaid docs](https://mermaid-js.github.io/)

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
```
''')

Page()

image

vscode-jupyter version: v2024.1.100

@iisakkirotko
Copy link
Collaborator

Hi @Chaoses-Ib!

Thanks for opening the issue. I think mostly this is related to #175, and is caused by MathJax not being loaded by default in Jupyter. As noted in that issue, this can be solved in Jupyter Lab / Notebook by using something else that initiates MathJax (such as IPython.display.Math, or using a markdown cell). Unfortunately this doesn't work in VSCode, since there KaTeX is used instead of MathJax and therefore MathJax is never loaded.

You can see similar issues in ipywidgets (see, e.g. jupyter-widgets/ipywidgets#3847) , so I think the issue should get fixed there first. It seems like jupyter-widgets/ipywidgets#3847 doesn't fix the issue in VSCode, but only in Jupyter environments, although I didn't do any extensive testing.

I suspect the story is similar for Mermaid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants