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

when declaring participants the elements are generated twice #370

Closed
jorgheymans opened this issue Jul 7, 2016 · 6 comments
Closed

when declaring participants the elements are generated twice #370

jorgheymans opened this issue Jul 7, 2016 · 6 comments

Comments

@jorgheymans
Copy link

from the documentation

sequenceDiagram
    participant John
    participant Alice
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!

using the live editor this is rendered correctly, but using the CLI i get this

image

C:\windows\system32\cmd.exe /c (mermaid tmp\test.txt -o C:\RC\tmp)
Num files to execute : 1
ready to execute png: test.txt.png
CONSOLE: [10:13:11 (182)]  Starting rendering diagrams (from line # in "")
CONSOLE: [10:13:11 (182)]  Start On Load before: undefined (from line # in "")
CONSOLE: [10:13:11 (182)]  Initializing mermaidAPI (from line # in "")
CONSOLE: [10:13:11 (182)]  Setting conf  gantt - useWidth (from line # in "")
CONSOLE: [10:13:11 (182)]  Setting config: gantt useWidth to 1200 (from line # in "")
CONSOLE: [10:13:11 (187)]  Adding message from=Alice to=John message=Hello John, how are you? type=0 (from line # in "")
CONSOLE: [10:13:11 (187)]  Adding message from=John to=Alice message=Great! type=1 (from line # in "")
CONSOLE: [10:13:11 (196)]  For line height fix Querying: #mermaidChart0 .actor-line (from line # in "")
saved png: test.txt.png
Hit any key to close this window...
@kdoba22
Copy link

kdoba22 commented Jul 11, 2016

Has anyone figured out what is causing this issue?
I have a very similar issue with IE 11 where the SVG markup is repeated twice, but it works correctly with Chrome and Firefox.

@michaelritsema
Copy link

Make sure you don't have white space after the John's participant declaration. They should chop off the white space when registering it, but they don't. So when you create the edge from John, "John " is registered but not "John", so it registers a new one at the end.

@jorgheymans
Copy link
Author

there is no whitespace after either participant declaration, so this is not it.

@martijnschoenmakers
Copy link

I have the same problem.
Also since I want to activate one off the participants from the beginning, this is leading to issues (since I cannot activate a participant that is not yet created.)

Would be nice if anyone can find what is causing this.

@dsschneidermann
Copy link

dsschneidermann commented Mar 27, 2017

Generated SVG is

<rect x="0" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor" />

<text x="75" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle;">

    <tspan x="75" dy="0">Example Participant

    </tspan>

</text>

So it looks like it is a line-feed problem. Switching my input file from

CRLF -> LF

fixed the issue, and I tried to write a quick string.replace fix, but can't get that to work

@tylerlong
Copy link
Collaborator

Try the latest CLI program: https://github.com/mermaidjs/mermaid.cli

Feel free to reopen if you still have this issue.

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
…yarn/develop/prettier-2.4.1

chore(deps-dev): bump prettier from 2.4.0 to 2.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants