typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

Mermaid code highlighting when using flowchart #5196

Open Lakitna opened 2 years ago

Lakitna commented 2 years ago

Describe the bug

Mermaid code blocks are great. When using most diagram types, the code highlights properly too.

However, code highlighting is broken for the diagram type flowchart. Rendering of the diagram does work properly.

To Reproduce Steps to reproduce the behavior:

  1. Create a code block with language mermaid
  2. Create a diagram of type flowchart

Expected behavior I expect code highlighting to work for all supported diagram types.

Screenshots / Screencasts

Chart type graph (works as expected)

image

Chart type flowchart (renders properly, but no code highlighting)

image

Sample Markdown File

```mermaid
graph LR

P[Provider]
PC[Provider Contract]
CC[Consumer Contract]
C[Consumer]

P --- PC
PC --> CC --> PC
CC --- C
```

```mermaid
flowchart LR

P[Provider]
PC[Provider Contract]
CC[Consumer Contract]
C[Consumer]

P --- PC
PC --> CC --> PC
CC --- C
```

Desktop (please complete the following information):

Typora Version e.g: 1.2.5

tennr commented 2 years ago

this happens on macOS 12.4 as well; dev 1.3.3

nanoant commented 2 years ago

Same here, both Windows 10 and macOS.