Skip to content

Commit

Permalink
Document required quotes in Mermaid subgraph titles
Browse files Browse the repository at this point in the history
Mermaid v8.2.3 added support for styling in subgraphs, but if there are
multiple words in a title, quotes are required.

```
graph TB

  SubGraph1 --> SubGraph1Flow
  subgraph "SubGraph 1 Flow"
  SubGraph1Flow(SubNode 1)
  SubGraph1Flow -- Choice1 --> DoChoice1
  SubGraph1Flow -- Choice2 --> DoChoice2
  end

  subgraph "Main Graph"
  Node1[Node 1] --> Node2[Node 2]
  Node2 --> SubGraph1[Jump to SubGraph1]
  SubGraph1 --> FinalThing[Final Thing]
end
```

```
graph TB

  SubGraph1 --> SubGraph1Flow
  subgraph SubGraph 1 Flow
  SubGraph1Flow(SubNode 1)
  SubGraph1Flow -- Choice1 --> DoChoice1
  SubGraph1Flow -- Choice2 --> DoChoice2
  end

  subgraph Main Graph
  Node1[Node 1] --> Node2[Node 2]
  Node2 --> SubGraph1[Jump to SubGraph1]
  SubGraph1 --> FinalThing[Final Thing]
end
```

* mermaid-js/mermaid#845
* mermaid-js/mermaid#391 (comment)

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65338
  • Loading branch information
stanhu committed Jul 31, 2019
1 parent af9b1ff commit 7d2b579
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions doc/user/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,49 @@ graph TD;
C-->D;
```

### Subgraphs

NOTE: **Note:** GitLab 12.1 and up now [requires quotes around subgraph
titles that contain multiple words](https://github.com/knsv/mermaid/pull/845).

Subgraphs can also be included:

~~~
```mermaid
graph TB
SubGraph1 --> SubGraph1Flow
subgraph SubGraph 1 Flow
SubGraph1Flow(SubNode 1)
SubGraph1Flow -- Choice1 --> DoChoice1
SubGraph1Flow -- Choice2 --> DoChoice2
end
subgraph Main Graph
Node1[Node 1] --> Node2[Node 2]
Node2 --> SubGraph1[Jump to SubGraph1]
SubGraph1 --> FinalThing[Final Thing]
end
```
~~~

```mermaid
graph TB
SubGraph1 --> SubGraph1Flow
subgraph "SubGraph 1 Flow"
SubGraph1Flow(SubNode 1)
SubGraph1Flow -- Choice1 --> DoChoice1
SubGraph1Flow -- Choice2 --> DoChoice2
end
subgraph "Main Graph"
Node1[Node 1] --> Node2[Node 2]
Node2 --> SubGraph1[Jump to SubGraph1]
SubGraph1 --> FinalThing[Final Thing]
end
```

### Emoji

> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/user/markdown.md#emoji).
Expand Down

0 comments on commit 7d2b579

Please sign in to comment.