Closed craigmac closed 1 year ago
@craigmac : please, provide the version of mermaid-cli. Another thing, be aware, that MacOS users need to use our provided docker image, because of https://github.com/mermaid-js/mermaid-cli/issues/288
My mistake, the OS is actually docker: pandoc/latex:2.18-ubuntu
container with mermaid-cli version 9.1.7
I'm experiencing the same issue on Windows using version 9.2.2:
Source File:
# Overview
Hello, World!
```mermaid
graph TD
PSTN -->|Inbound Call| P1[PRI 1] --> CUBE
PSTN -->|Inbound Call| P2[PRI 2] --> CUBE
PSTN -->|Inbound Call| P3[PRI 3] --> CUBE
CUBE(CUBE) -->CUBE_ROUTE_CALL{Route Call}
CUBE_ROUTE_CALL -->|eFax| XMEDIUS(XMedius XMFax)
CUBE_ROUTE_CALL -->|Voice| CUCM(CUCM)
CUCM --> CUCM_ROUTE_CALL{Route Call}
CUCM_ROUTE_CALL -->|IVR| UCCX(UCCX)
CUCM_ROUTE_CALL -->|Voicemail| CUC(CUC)
CUCM_ROUTE_CALL -->|Endpoint| DEVICE[End Device]
Test
```bash
npm i @mermaid-js/mermaid-cli
.\node_modules\.bin\mmdc -i .\tmp\MASTER.md -o .\tmp\MASTER_formatted.md
Produces:
# Overview
Hello, World!
![diagram](./MASTER_formatted-1.svg)
## Testing
Test
I was able to work around the issue by surrounding the block with comments:
# Overview
Hello, World!
<!---->
```mermaid
graph TD
PSTN -->|Inbound Call| P1[PRI 1] --> CUBE
PSTN -->|Inbound Call| P2[PRI 2] --> CUBE
PSTN -->|Inbound Call| P3[PRI 3] --> CUBE
CUBE(CUBE) -->CUBE_ROUTE_CALL{Route Call}
CUBE_ROUTE_CALL -->|eFax| XMEDIUS(XMedius XMFax)
CUBE_ROUTE_CALL -->|Voice| CUCM(CUCM)
CUCM --> CUCM_ROUTE_CALL{Route Call}
CUCM_ROUTE_CALL -->|IVR| UCCX(UCCX)
CUCM_ROUTE_CALL -->|Voicemail| CUC(CUC)
CUCM_ROUTE_CALL -->|Endpoint| DEVICE[End Device]
Test
Which produced the following:
````markdown
# Overview
Hello, World!
<!---->
![diagram](./MASTER_formatted-1.svg)
<!---->
## Testing
Test
Hope that helps!
Describe the bug mmdc removes mermaid code blocks as intended, but messes with surround empty lines (one above and one below the code block).
To Reproduce Steps to reproduce the behavior:
Sample markdown (not sure if this will render correctly here, but added 4 backticks for the embedded mermaid sequence):
Expected behavior
Replaced like this:
Actual behavior
Notice the newlines have been removed - one just below the markdown heading, and one after the
![diagram]
line: this causes markdownlint errors and also a YAML parsing error because the---
line doesn't have an empty line above and below it, and so the parser thinks we are trying to start a YAML block.Desktop (please complete the following information):
Smartphone (please complete the following information):