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

Brackets in a node with text? #213

Closed
orschiro opened this issue Sep 24, 2015 · 5 comments
Closed

Brackets in a node with text? #213

orschiro opened this issue Sep 24, 2015 · 5 comments
Labels
Type: Other Not an enhancement or a bug

Comments

@orschiro
Copy link

Dear all,

I looked at the following example from the documentation:

id1[This is the text in the box]

I assumed to add brackets to the text as follows:

id1[This is the (text) in the box]

However, the Live Editor does not render the chart when using brackets.

Are brackets in node link texts supported?

Thankfully,

Robert

@knsv
Copy link
Collaborator

knsv commented Sep 26, 2015

Put the text within quotes and you will have a diagram:

graph LR
id1["This is the (text) in the box"]

Good luck!

@knsv
Copy link
Collaborator

knsv commented Sep 26, 2015

Thanks for bringing this up. I added a small example in the docs for this case:
http://knsv.github.io/mermaid/#special-characters-that-break-syntax

@knsv knsv added the Type: Other Not an enhancement or a bug label Sep 26, 2015
@orschiro
Copy link
Author

It works. Thanks @knsv!

@shatadrusaha
Copy link

I am trying to use mermaid in a RMD document. But, when I try to use bracket within quotes, it doesn't work. Although, that was the solution provided above. My code works fine, when I don't use brackets. The code is given below:

mermaid("
graph TB;
A[Data Extraction
BGL + PCD vars] --> B[WOE Binning
PCD vars];

  B --> C[Data Sampling <br/> Train - 70% <br/> Test - 30%];
")

This produces the following graph:

image

I am trying to have the graph look like this in the first block

Data Extraction
(BGL + PCD vars)

@callum-savage
Copy link

callum-savage commented Oct 8, 2019

@shatadrusaha

In an RMD document, you can still use double quotes for the node label if you surround the mermaid diagram with single quotes (the reverse doesn't seem to work).

library(DiagrammeR)

mermaid('
  graph TB;
  A["Data Extraction <br/> (BGL + PCD vars)"] --> B[WOE Binning <br/> PCD vars];
  B --> C[Data Sampling <br/> Train - 70% <br/> Test - 30%];
')

Which results in the following:

image

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
…yarn/develop/monaco-editor-0.25.0

Bump monaco-editor from 0.24.0 to 0.25.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Other Not an enhancement or a bug
Projects
None yet
Development

No branches or pull requests

4 participants