mjbvz / vscode-markdown-mermaid

Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
MIT License
633 stars 114 forks source link

TypeError: Cannot set properties of undefined (setting 'rank') when pointing a node to a subgraph #168

Closed hyperrecursive closed 1 year ago

hyperrecursive commented 1 year ago

Here is the example code:

```mermaid
graph LR
    subgraph sg0
        node0 --> sg1
        node0 --> node2
        subgraph sg1
            node3
        end
        subgraph sg2
        end
    end
```

In VS Code (and GitHub as well), the following error is printed:

TypeError: Cannot set properties of undefined (setting 'rank')

It should be possible according to #644. This is how it is rendered in the live editor:

image
mjbvz commented 1 year ago

Renders fine for me in the latest extension version:

Screenshot 2023-01-23 at 5 04 10 PM

hyperrecursive commented 1 year ago

I've just tested it again and found out that the Markdown Preview Enchanced steals the rendering of Mermaid diagrams if both extensions are enabled.