Skip to content

Commit

Permalink
Merge pull request #5570 from abitrolly/patch-1
Browse files Browse the repository at this point in the history
Explain line breaks in `sequenceDiagram.md`
  • Loading branch information
sidharthv96 authored Jun 20, 2024
2 parents d95c159 + d65e78f commit 3af4020
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
24 changes: 21 additions & 3 deletions docs/syntax/sequenceDiagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,35 @@ sequenceDiagram
Note over Alice,John: A typical interaction
```

It is also possible to add a line break (applies to text input in general):
## Line breaks

Line break can be added to Note and Message:

```mermaid-example
sequenceDiagram
Alice->John: Hello John, how are you?
Alice->John: Hello John,<br/>how are you?
Note over Alice,John: A typical interaction<br/>But now in two lines
```

```mermaid
sequenceDiagram
Alice->John: Hello John, how are you?
Alice->John: Hello John,<br/>how are you?
Note over Alice,John: A typical interaction<br/>But now in two lines
```

Line breaks in Actor names requires aliases:

```mermaid-example
sequenceDiagram
participant Alice as Alice<br/>Johnson
Alice->John: Hello John,<br/>how are you?
Note over Alice,John: A typical interaction<br/>But now in two lines
```

```mermaid
sequenceDiagram
participant Alice as Alice<br/>Johnson
Alice->John: Hello John,<br/>how are you?
Note over Alice,John: A typical interaction<br/>But now in two lines
```

Expand Down
15 changes: 13 additions & 2 deletions packages/mermaid/src/docs/syntax/sequenceDiagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,22 @@ sequenceDiagram
Note over Alice,John: A typical interaction
```

It is also possible to add a line break (applies to text input in general):
## Line breaks

Line break can be added to Note and Message:

```mermaid-example
sequenceDiagram
Alice->John: Hello John, how are you?
Alice->John: Hello John,<br/>how are you?
Note over Alice,John: A typical interaction<br/>But now in two lines
```

Line breaks in Actor names requires aliases:

```mermaid-example
sequenceDiagram
participant Alice as Alice<br/>Johnson
Alice->John: Hello John,<br/>how are you?
Note over Alice,John: A typical interaction<br/>But now in two lines
```

Expand Down

0 comments on commit 3af4020

Please sign in to comment.