question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sequence Diagrams with messageAlign smash text with `<br>`

See original GitHub issue

Describe the bug When create a sequence diagram with messageAlign: left config and the text contains <br> line breaks, all the lines gets smashed into the first line.

To Reproduce Steps to reproduce the behavior:

  1. Set the config to { "sequence": { "messageAlign": "left"} }
  2. Create a sequence diagram using <br> in the message

Expected behavior The diagram to have left aligned text with line breaks, as in https://github.com/mermaid-js/mermaid/pull/1315 image

Screenshots <kbd>image</kbd>

You can see in the screenshot everything is smashed into the first line.

Code Sample Live Editor example

```mermaid
%%{init: { 'sequence': {'messageAlign': 'left'} }}%%
sequenceDiagram
User->>Browser: Click hello
Browser->>Server: Get /hello HTTP/1.1 <br> Host: example.com <br> Accept: text/html
Server->>Browser: HTTP/1.1/ 200 OK <br> Content-Type: text/html <br> Content-Length: 42
```

Github Render:

%%{init: { 'sequence': {'messageAlign': 'left'} }}%%
sequenceDiagram
User->>Browser: Click hello
Browser->>Server: Get /hello HTTP/1.1 <br> Host: example.com <br> Accept: text/html
Server->>Browser: HTTP/1.1/ 200 OK <br> Content-Type: text/html <br> Content-Length: 42

Desktop (please complete the following information):

  • OS: macOS 12.3.1
  • Browser: Chrome
  • Version: 101.0.4951.54

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

1reaction
PackElendcommented, Oct 6, 2022
0reactions
PackElendcommented, Sep 21, 2022

If you could do it today, it would be great otherwise I’ll do it tomorrow (late)

Le mer. 21 sept. 2022 à 19:20, Kevin Woo @.***> a écrit :

You’re right, it does look a little weird.

Seems like messageAlign moved the message left, center, or right of the connection line.

Maybe we should open a new issue to maybe introduce messageAlign: centerLeft?

— Reply to this email directly, view it on GitHub https://github.com/mermaid-js/mermaid/issues/3011#issuecomment-1254004891, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3AYDZGLJBGXBRRL4L5C6DV7M7XPANCNFSM5VJD3AJA . You are receiving this because you were mentioned.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sequence Diagrams with Mermaid and Diagrams.net
Another tool that gets mentioned for Diagrams-as-Code is Mermaid which “uses Markdown-inspired text definitions and a renderer to create and ...
Read more >
Sequence Diagram syntax and features - PlantUML
Basic examples. The sequence -> is used to draw a message between two participants. Participants do not have to be explicitly declared.
Read more >
Can I add a line break when I add a note using markup ...
Hi,. I am using this quite cool feature "Markup" for UML Sequence, this allows me to "write" the sequence diagram. I am able...
Read more >
UML Sequence Diagram - Ashley's PlantUML Doc
A UML Sequence diagram shows how messages go back and forth between objects over time. ... The basic syntax for a line in...
Read more >
mermaid - Generation of diagrams and flowcharts ... - UNPKG
It is possible to break text into different rows by using <br/> as a line breaker. %% Example of sequence diagram sequenceDiagram participant...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found