mgaitan / sphinxcontrib-mermaid

Mermaid diagrams in yours sphinx powered docs
http://sphinxcontrib-mermaid-demo.readthedocs.io/en/latest/
Other
338 stars 96 forks source link

Sequence diagram empty directive marked as incorrect mermaidJS #143

Closed MaxWinsemius closed 2 months ago

MaxWinsemius commented 5 months ago

I noticed when working on sequenceDiagrams, that the method of rendering does not match with the mermaid live renderer.

When using the following snippet:

sequenceDiagram
    node_a->>node_b: comment
    node_b->>node_a: 

(Note the space at the end of line 3)

I get the following render from the live renderer:

image

But an error if build using sphinx:

image

Now I do not know if this syntax is even supported on purpose by Mermaid, since I didn't find any examples of that either and if I remove the space on line 3 it also fails.

timkpaine commented 2 months ago

This is a bit of a quirk of how that website works. That example does NOT work on the mermaid main docs. However, easy to see why, it is not valid for that diagram type to have a space as the comment, but the editor encodes it. You can do the same with this

```mermaid
sequenceDiagram
    node_a->>node_b: comment
    node_b->>node_a: #nbsp;

```mermaid
sequenceDiagram
    node_a->>node_b: comment
    node_b->>node_a: #nbsp;