Rendering PlantUML in Markdown in VscCode Preview and Gitlab

75 views Asked by At

I have the following PlantUML diagram in a markdown file (sample.md):

### Sample UML Sequence Diagram

```PlantUML
@startuml UMLSequenceDiagram
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
@enduml
```
![](UMLSequenceDiagram.svg)

which renders in VsCode Markdown Preview as this:

Sample UML Sequence Diagram

@startuml UMLSequenceDiagram
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
@enduml

If this sample.md is added to a GitLab repository, the PlantUML diagram rendering is broken in GitLab. The fix is to change the token of the first line of the script to read like this (all lowercase):

```plantuml

That does fix the rendering in GitLab but now VsCode Markdown Preview is broken.

Has anyone succeeded to get both renderers working with a single plantuml token?

0

There are 0 answers