From c904c7d21a57ac6ea50073ae885478c96d0a4932 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sat, 15 Jun 2024 12:29:30 +0300 Subject: [PATCH 1/2] Explain line breaks in `sequenceDiagram.md` Closes https://github.com/mermaid-js/mermaid/issues/4351 --- .../mermaid/src/docs/syntax/sequenceDiagram.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/docs/syntax/sequenceDiagram.md b/packages/mermaid/src/docs/syntax/sequenceDiagram.md index 4fc25bd12..ae2c7fd02 100644 --- a/packages/mermaid/src/docs/syntax/sequenceDiagram.md +++ b/packages/mermaid/src/docs/syntax/sequenceDiagram.md @@ -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,
how are you? + Note over Alice,John: A typical interaction
But now in two lines +``` + +Line breaks in Actor names requires aliases: + +```mermaid-example +sequenceDiagram + participant Alice as Alice
Johnson + Alice->John: Hello John,
how are you? Note over Alice,John: A typical interaction
But now in two lines ``` From d65e78f9e23f863cb3ab34717b3394877a03a29f Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 20 Jun 2024 22:15:52 +0530 Subject: [PATCH 2/2] chore: Update docs --- docs/syntax/sequenceDiagram.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/syntax/sequenceDiagram.md b/docs/syntax/sequenceDiagram.md index a8455964e..e39e660e8 100644 --- a/docs/syntax/sequenceDiagram.md +++ b/docs/syntax/sequenceDiagram.md @@ -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,
how are you? Note over Alice,John: A typical interaction
But now in two lines ``` ```mermaid sequenceDiagram - Alice->John: Hello John, how are you? + Alice->John: Hello John,
how are you? + Note over Alice,John: A typical interaction
But now in two lines +``` + +Line breaks in Actor names requires aliases: + +```mermaid-example +sequenceDiagram + participant Alice as Alice
Johnson + Alice->John: Hello John,
how are you? + Note over Alice,John: A typical interaction
But now in two lines +``` + +```mermaid +sequenceDiagram + participant Alice as Alice
Johnson + Alice->John: Hello John,
how are you? Note over Alice,John: A typical interaction
But now in two lines ```