Mermaid-Chart / vscode-mermaid-preview

Previews Mermaid diagrams
MIT License
148 stars 16 forks source link

Incorrect when there is two classDiagram in one markdown file #84

Open linyoubin opened 5 years ago

linyoubin commented 5 years ago

If threre is two classDiagram in one markdown file, The second classDiagram is incorrect (vscode:1.36.1 mermaid preview: 0.12.2)

Expected behaviour

classDiagram
Class1 <|-- Class2
classDiagram
Class4 <|-- Class3

Actual behaviour

图片

vstirbu commented 5 years ago

Thanks for brining this thing up.

I'm not able to replicate the behaviour. Using the following snippet I get always a single diagram rendered when the cursor is inside the fence:

```mermaid
classDiagram

Class1 <|-- Class2
```

```mermaid
classDiagram

Class4 <|-- Class3
```

Based on your sample code it seems that you have a space between the fence `` andmermaid`. If that is correct you should not get any rendering. Anyway, there should not be two diagrams rendered in any case.

Can you post the exact markdown file you are trying to render, details about operating system, a better screen capture that shows also the title of the preview panel, maybe the console log? Anything that would help hunting down the source... Thanks!

linyoubin commented 5 years ago

Thank you for you reply.

My OS is Windows 7 service pack1 64bit

Here is my screen capture and markdown file. 图片

My markdown file: test.zip