dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.68k stars 252 forks source link

Mermaid mindmap diagram not getting rendered in the preview #3922

Open thealokkr opened 1 year ago

thealokkr commented 1 year ago

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

Describe the bug

Mermaid mindmap diagrams are not getting rendered in the preview. The same mindmap snippet is working fine in the online editor

To Reproduce

Steps to reproduce the behavior:

  1. Add the following snippet to a markdown file
  2. mindmap
    root((mindmap))
    Origins
    Research
    Tools
  3. Click on the Dendron toggle preview
  4. The preview shows - Syntax error in graph mermaid version 9.1.3

Expected behavior

  1. The mindmap diagram must be rendered in the preview. The same snippet is working fine in the online mermaid editor (https://mermaid.live/edit#pako:eNotT8sKwjAQ_JWyJ4Uqba195OxVBPUkuSzNqoEmW9IU1NJ_N7be5rE7w4zQsCIQYLRVBjtpo8gx-9XqL6zXPymKTk4_tO0Xcqae0DXPhV2Z22BADIacQa1C3PizJPgnGZIgAlR0x6H1EqSdwikOni9v24DwbqAYhk6hp4PGh0MD4o5tH9QOLYgRXiDqZFsmRZlW-zqtyqwqYniD2OTbPMmTrE6LLC92-90Uw4c5BKTz823GSwMp7dkdl7nz6ukLblhPQg)

Screenshots

Dendron preview result

image

Mermaid online editor view

image

Desktop (please complete the following information)

Additional context

Add any other context about the problem here.

Dendron Log file

Please attach the output of > Dendron:Dev: Open Logs here

e5k commented 1 year ago

Hi - any update on that? Thanks loads

shyft-eric commented 1 year ago

I believe this issue is related to the mermaid plugin moving to ESM earlier this year, which based on what I can find is not supported (at least as of last comments on this thread: https://github.com/orgs/mermaid-js/discussions/4148) by electron, which is what VS Code is built on. If there is a fix, it sounds like a non-trivial update to the VS Code plugin.

e5k commented 1 year ago

Thanks @shyft-eric. Bummer!