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

State diagram : having a space in the state name #1342

Closed
sharkx opened this issue Apr 8, 2020 · 3 comments · Fixed by #2501
Closed

State diagram : having a space in the state name #1342

sharkx opened this issue Apr 8, 2020 · 3 comments · Fixed by #2501
Labels
Status: Approved Is ready to be worked on Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@sharkx
Copy link

sharkx commented Apr 8, 2020

This is a great library. Thank you for making it available.

The question I have is fairly simple : how to add a space in the state name for the state diagram.

Here's what I've tried, and none gives a proper result :

1, for every state add a line for the 'label' like : : some long text
Kinda works, but it sets the text as title for the state with an empty area below

  1. replace all spaces (and other specials) by their escaped counterpart; for example with Fixed reference to Git repo. #32;
    Also works, but creates very large nodes; I'm guessing the node width is calculated on the length of the input string, not the actual string.
    I'm also thinking that this must be the easiest to fix.

Any help is appreciated.
Thank you.

@sharkx sharkx added Contributor needed Type: Other Not an enhancement or a bug labels Apr 8, 2020
@github-actions github-actions bot added the Status: Triage Needs to be verified, categorized, etc label Apr 8, 2020
@Kochise
Copy link

Kochise commented Nov 12, 2020

Yswsii: Your state with spaces in it
[*] --> Yswsii

@aleneum
Copy link

aleneum commented Nov 12, 2020

Hi @Kochise,

Yswsii: Your state with spaces in it
[*] --> Yswsii

I think this is what @sharkx referes to with

1, for every state add a line for the 'label' like : : some long text
Kinda works, but it sets the text as title for the state with an empty area below

The "empty area below" is probably the added horizontal line and the empty space in the node which you can see here:

mermaid-diagram-20201112122725

Compare this to a state without a separate label:

Screenshot 2020-11-12 123138a

@Kochise
Copy link

Kochise commented Nov 12, 2020

Yeah, ok, now I get it (a picture, 1000 words, ...)

I don't know, I've got the same issue, I used this as a fallback until a proper solution is found.

@jgreywolf jgreywolf added Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect and removed Contributor needed Type: Other Not an enhancement or a bug labels Feb 2, 2021
Olshansk added a commit to Olshansk/mermaid that referenced this issue Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Approved Is ready to be worked on Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants