Closed stanhu closed 5 years ago
This problem was not in 8.0.0, but seems to have been introduced in 8.1.0 via https://github.com/knsv/mermaid/pull/845.
You need to write "Mobile Unit" with Quotes
Right, this surprised a number of our users. I asked whether we can preserve backwards compatibility: https://github.com/knsv/mermaid/pull/845#issuecomment-516577160
Let move this here. I encourage backwards compatability and think this needs some investigating. I will reopen this issue for this discussion.
Thinking aloud:
So after doing a bit of research. In this case we should consider the text a title under the assumption we don't see the id[*] syntax.
Known details
a["foo"]
prior to 7.xAssumptions:
So these are the possible formats...
%% No style id and considered text
subgraph "a b"
subgraph old style that is broken
subgraph a-b-c
%% with style id
subgraph uid1[text of doom]
subgraph uid2["text of doom"]
subgraph uid3[abcdef]
These are the different types of things that can technically exist. (not jijson)
It should be possible to handle the "old style that is broken" as long as it does not contain a bracket.
Fixed as of v 8.2.4
for those that stumble upon the same problem while linking subgraphs in a flowchart as such:
A --> Sub Graph Name (spaces in the name)
subgraph Sub Graph Name
or
subgraph "Sub Graph Name"
I've found the examples given here in this issue helpful https://github.com/mermaid-js/mermaid/issues/895#issuecomment-517966169 so I ended up with:
A --> graphId
subgraph graphId[Sub Graph Name]
Describe the bug
Using a title with spaces results in the error:
To Reproduce
Use the sample graph: https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggQlQ7XG5cbiAgdmV0cm9uaWNzIC0tLSB1aHVyYTtcbiAgb2J1IC0tLSB1aHVyYTtcbiAgZG9uZ2xlIC0tLSB1aHVyYTtcbiAga2Fma2EgLS0tIHVodXJhO1xuICB4bXBwIC0tLSB1aHVyYTtcbiAga2Fma2EgLS0tIHRvbGw7XG4gIGthZmthIC0tLSB0ZWxlO1xuXG4gIHN1YmdyYXBoIE1vYmlsZSBVbml0c1xuICAgIHZldHJvbmljc1tWZXRyb25pY3NdO1xuICAgIG9idVtUb2xsIE9CVV07XG4gICAgZG9uZ2xlW0RvbmdsZV07XG4gIGVuZFxuXG4gIHN1YmdyYXBoIFwiVWh1cmEgQ2x1c3RlclwiXG4gICAgdWh1cmFbVWh1cmFdO1xuICAgIGNvbnN1bFtDb25zdWxdO1xuICAgIGNpZnNbU2hhcmVkIEZpbGVzeXN0ZW1dO1xuICAgIGNvbnN1bCAtLS0gdWh1cmE7XG4gICAgdWh1cmEgLS0tIGNpZnM7XG4gIGVuZFxuXG4gIHN1YmdyYXBoIEludGVyZmFjZVxuICAgIGthZmthW0thZmthXTtcbiAgICB4bXBwW1hNUFBdO1xuICBlbmRcblxuICBzdWJncmFwaCBDbGllbnRzXG4gICAgdG9sbFtUb2xsIFBsYXRmb3JtXTtcbiAgICB0ZWxlW1RlbGVtYXRpY3NdO1xuICBlbmQiLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ/error/UGFyc2UgZXJyb3Igb24gbGluZSAxMToKLi4uOyAgc3ViZ3JhcGggTW9iaWxlIFVuaXRzICAgIHZldHJvbmljcwotLS0tLS0tLS0tLS0tLS0tLS0tLS1eCkV4cGVjdGluZyAnU0VNSScsICdORVdMSU5FJywgJ0VPRicsICdESVInLCAnRE9XTicsICdTUVMnLCAnTUlOVVMnLCAnTlVNJywgJ0NPTU1BJywgJ0FMUEhBJywgJ0NPTE9OJywgJ0JSS1QnLCAnRE9UJywgJ1BVTkNUVUFUSU9OJywgJ1VOSUNPREVfVEVYVCcsICdQTFVTJywgJ0VRVUFMUycsICdNVUxUJywgZ290ICdTUEFDRSc
Expected behavior
Subgraphs render.
Screenshots
Desktop (please complete the following information):
Additional context