executablebooks / jupyterlab-myst

Use MyST Markdown directly in Jupyter Lab
https://mystmd.org/guide/quickstart-jupyter-lab-myst
BSD 3-Clause "New" or "Revised" License
133 stars 15 forks source link

JupyterLab-MyST incompatible with HoloViz Panel #101

Open riziles opened 1 year ago

riziles commented 1 year ago

Describe the bug

No action required, just reporting an incompatibility issue:

Installing JupyterLab-MyST prevents Panel from correctly rendering Markdown components.

I love MyST, but I had to remove the JupyterLab extension because of this.

Reproduce the bug

  1. Install Panel
  2. Install JupyterLab-MyST
  3. Add the following cell to a notebook:
    import panel as pn
    pn.extension()
    pn.pane.Markdown("""
    # What happened to all my headers????
    """)
welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

philippjfr commented 1 year ago

I somewhat suspect this is caused by Panel adding a .markdown CSS class to the converted HTML tag. In Panel 1.x this should no longer be an issue because we render components into the shadow DOM which likely won't be affected by JupyterLab-MyST.

rowanc1 commented 1 year ago

Thanks @riziles for the bug report and @philippjfr for the pointer!

If it is stealing the first header, it could also be that the markdown is being parsed by MyST with the frontmatter parsing being turned on (which tries to find the title, and then render as a title block in the first cell). There might be other compatibility issues as well, we will try to sort them out!