-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
Unexpected empty node in Mermiad stateDiagram with a choice, fork or join #911
Comments
Looks like it's a problem with the |
So digging into this it looks like the HTML block that is generated has to be HTML encoded. MM now generates an unencoded block: <div class="mermaid">
%%{init: {'theme': 'default'}%%
stateDiagram-v2
state c <<choice>>
[*] --> c
c --> TRUE : Yes
c --> FALSE : NO
</div> which produces the extra node. If changed to this: <div class="mermaid">
%%{init: {'theme': 'default'}%%
stateDiagram-v2
state c >>choice<<
[*] --> c
c --> TRUE : Yes
c --> FALSE : NO
</div> then it works. This should be an easy fix - as long as that doesn't break something else 😄 FWIW, if you use the ```mermaid
%%{init: {'theme': 'default'}%%
stateDiagram-v2
state c <<choice>>
[*] --> c
c --> TRUE : Yes
c --> FALSE : NO
``` it should work (with the fix). |
Interesting... Yeah, the triple tick was the first thing I tried, I think I even started to mention that in my issue text, but for some reason I trimmed that out. Either way, it had the same effect, with or without. Hopefully this only fixes and doesn't unfix something else 😄 |
This is fixed in the latest update ( 2.3.16+) |
So if I use the DIV syntax, it's still there in v2.3.16 This is expected behavior, yes? Your earlier statement about needing to encode any of that ourselves when using the DIV syntax is kinda implying that the triple-tick syntax is the preferred syntax? I've been using the DIV syntax because that's what the default mermaid snippet you have uses, plus I prefer the white formatting given to the DIV code than the light-blue formatting of the tick syntax, but I'll use whatever works :) Thanks! |
Correct. triple syntax encodes, The default snippet shows both, but it's been updated either way. Official documentation is here: |
SUMMARY
There's an unexpected empty node in a Mermaid stateDiagram which has a
<<choice>>
directive. This isn't seen in the live mermaid editor, nor in VSCode.Normally I would chalk this up to a Mermaid bug, but I'm only seeing it in MM.
MM has additional empty node in the top right of the diagram
VSCode does not have this
Live editor does not have this
Link to the live editor LINK
I'm guessing it has something to do with the double
<<
and>>
? Incidentally, if I don't use<<choice>>
and just use normal nodes, this doesn't show up.It looks like it also happens with
<<fork>>
... and
<<join>>
The text was updated successfully, but these errors were encountered: