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

In workflow graph, the text on the link can't be wrapped by <br/> tag if the link is styled explicitly by linkStyle in the code #1088

Closed
georgelichen opened this issue Nov 26, 2019 · 3 comments · Fixed by #1132
Assignees
Labels
Graph: Flow Retained Nonperishable Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@georgelichen
Copy link

georgelichen commented Nov 26, 2019

In workflow graph, the text on the link can be wrapped by
tags in the text. Here is an example code:

graph LR
A[Task1<br/>Line2] -->|Text<br/>Line2| B(Task2<br/>Line2)

Live editor url:
https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBBW1Rhc2sxPGJyLz5MaW5lMl0gLS0-fFRleHQ8YnIvPkxpbmUyfCBCKFRhc2syPGJyLz5MaW5lMikiLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ

But, if this link is styled by linkStyle in the code, the <br/> will be explained as a plain text rather than carriage return. Here is an example code:

graph LR
A[Task1<br/>Line2] -->|Text<br/>Line2| B(Task2<br/>Line2)
linkStyle 0 stroke:DarkGray,stroke-width:2px

Live editor url:
https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFJcbiAgICBBW1Rhc2sxPGJyLz5MaW5lMl0gLS0-fFRleHQ8YnIvPkxpbmUyfCBCKFRhc2syPGJyLz5MaW5lMilcblxubGlua1N0eWxlIDAgc3Ryb2tlOkRhcmtHcmF5LHN0cm9rZS13aWR0aDoycHgiLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9fQ

@georgelichen georgelichen added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 26, 2019
@georgelichen georgelichen changed the title In workflow graph, the text on the link can't be wrapped by <br/> tag if the link is styled by linkStyle in the codeexplicitly by In workflow graph, the text on the link can't be wrapped by <br/> tag if the link is styled explicitly by linkStyle in the code Nov 26, 2019
@GDFaber
Copy link
Member

GDFaber commented Dec 9, 2019

My first guess (without further investigation) is that replacing
does not work in that case because the regex search expects
to be used. But
seems to be automatically completed to
when creating the flowchart, which I have just tested in the live editor.

If that is correct, the regular expression could be modified to solve the problem. I can take a look at it during the week if that's alright with you.

@GDFaber
Copy link
Member

GDFaber commented Dec 9, 2019

This can be solved by changing the regular expression from /<br>/g to /<br ?\/?>/g to catch <br> as well as <br/> and <br />.

@GDFaber
Copy link
Member

GDFaber commented Dec 10, 2019

My PR is at #1132.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2019
@IOrlandoni IOrlandoni added Graph: Flow Retained Nonperishable Status: Approved Is ready to be worked on and removed Status: Triage Needs to be verified, categorized, etc labels Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Graph: Flow Retained Nonperishable Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants