Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support note text that spans multiple lines in sequence diagram #2199

Open
51ngul4r1ty opened this issue Jul 18, 2021 · 8 comments
Open

Support note text that spans multiple lines in sequence diagram #2199

51ngul4r1ty opened this issue Jul 18, 2021 · 8 comments
Labels
Graph: Sequence Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@51ngul4r1ty
Copy link

Is your feature request related to a problem? Please describe.
I would like to be able to have a long text span multiple lines. PlantUML solved this with use of embedded \n to force a new line.

Describe the solution you'd like
I would like the ability to have a note span multiple lines using either 1) embedded \n character sequence in the note text; OR 2) note syntax that would allow text to span multiple lines (something like "begin note", note text over multiple lines and then "end note" - I won't define exactly how this should look because I feel it is up to the implementor to define this)

Describe alternatives you've considered
The alternatives are defined above.

Additional context
No additional context.

@51ngul4r1ty 51ngul4r1ty added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jul 18, 2021
@dry4ng
Copy link

dry4ng commented Sep 29, 2021

Same.

@benallred
Copy link

Potential workaround: <br/>

At least it worked for me while previewing markdown/mermaid in VS Code.

@tekener
Copy link

tekener commented Jul 7, 2022

As a user coming from plantuml the only thing i disliked with mermaid❤️ was the "one-liner" note syntax.
I had some notes spanning 5-10 lines. Putting them all into one line using
makes the note render, but the markdown is unreadable with that. Also when using the
syntax the text is centered what i would not expected here (Miro, Plant, etc are aligning text inside notes on the left). Maybe an additional alignment tag would help here (but that is maybe an other feature request).

Example:

note over Actor: Sends the data fields: name=Max<br/>method=push<br/>cause=creation. All the fields are later handled by the Field-Service.  

vs possible multiline solution:

note over Actor: 
Sends the data fields: 
name=Max
method=push
cause=creation.

All the fields are later handled by the Field-Service. 
endnote 

@mkatychev
Copy link

Would using braces/parentheses as string delimiters work?

[StackOverflow](
http://stackoverflow.com)

Or triple quotes """like in toml:

# str1 becomes "Roses are red\nVioles are blue"
str1 = """
Roses are red
Violets are blue"""
# str2 becomes "The quick brown fox jumps over the lazy dog." (a single sentence with no line breaks). 
str2 = """\
  The quick brown \
  fox jumps over \
  the lazy dog.\
  """

@dmeehan1968
Copy link

I use Mermaid in Notion, and multiline notes have the last line clipped vertically (seems to be miscalculating the line height).

I can specify the note as separate lines without any special markup, but to solve the clipped last line, I add a line with &nbsp; on its own. eg:

note left of MyState
  This is a multi-line note
  that I don't want to be clipped
  &nbsp;
end note

@lemonlion
Copy link

I use Mermaid in Notion, and multiline notes have the last line clipped vertically (seems to be miscalculating the line height).

I can specify the note as separate lines without any special markup, but to solve the clipped last line, I add a line with &nbsp; on its own. eg:

note left of MyState
  This is a multi-line note
  that I don't want to be clipped
  &nbsp;
end note

Doesn't seem to work in the online editor at all:

https://mermaid.live/edit#pako:eNpFj7sOwjAMRX_F8gAL_EBZWRiYYMziJi6NlDilcYQQ4t9xeQjJg3V9LN3zQF8CY4dOKl8bi-d9pMtM2Ql5LTMc7yclZaD6W504kWJR4kGhDP8c4DzGCjYEuSWN2xSFYYGXo46kcIBQZK1wI1HQAj2DT3GaOCzISvo67ZywhPcbbjDznCkG6_hYCIc6cmaHna0pXkZ1Vv5pIDUtp7t47HRuvME2BWv11cFuoFQt5RBN6_ixfss_X0QwWws

@rbelem
Copy link

rbelem commented May 29, 2024

Are there any alternative methods to get multiline notes?

@GavinPen
Copy link
Contributor

I think #5460 also covers multiline notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Sequence Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants