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

Using Sequence Diagram is there any way to make some parts of the text in bold? #1844

Open
bundgaard opened this issue Jan 4, 2021 · 23 comments · May be fixed by #5705
Open

Using Sequence Diagram is there any way to make some parts of the text in bold? #1844

bundgaard opened this issue Jan 4, 2021 · 23 comments · May be fixed by #5705

Comments

@bundgaard
Copy link

First of all, thank you for an amazing product.

I was trying to convert some diagrams from sequencediagram.org to the flavor that is used inside mermaid.
I wanted to be able to emphasize/bold some text, either using Markdown or pure HTML, but it seems not to work.

note right of A: <b>BOLD ME</b> <em>EMPHASIZE</em> but not respected as a command.

Help us help you!

You want an answer. Here are some ways to get it quicker:

  • Use a clear and concise title.
  • Try to pose a clear and concise question.
  • Include as much, or as little, code as necessary.
  • Don't be shy to give us some screenshots, if it helps!
@bundgaard bundgaard added Contributor needed Type: Other Not an enhancement or a bug labels Jan 4, 2021
@github-actions github-actions bot added the Status: Triage Needs to be verified, categorized, etc label Jan 4, 2021
@GiovanH
Copy link

GiovanH commented Jan 6, 2021

Currently, I don't think there is a way to do this; messages in sequence diagrams are plain text (with the exception of some keywords), not HTML.

You could mark this as a feature request, or fork the project. Here's a place to start:

export const drawText = function(elem, textData) {

@jgreywolf jgreywolf added Type: Question and removed Contributor needed Status: Triage Needs to be verified, categorized, etc labels Feb 1, 2021
@pierreverbakel
Copy link

pierreverbakel commented Sep 2, 2021

I am 'old' to Mermaid and I am surprised to see that after changing to Mermaid 8.12 things like Bold using <b>The Bold Text </b> (My Text in Bold) and Italics using <i>The Italic Text </i> (My Text in Italics) have stopped working, which was working in Version 7.03 as I am now having to stick using it. Which is a shame
What was the reason of the decision to drop the usage of one of the most basic of "HTML 1.x" tags??
Nice to have the possibility to do a feature request, but what is the point if one looses that basic feature in the next version I am asking myself. Forced to stick with the 'old' now.

@alexfornuto
Copy link

I am 'new' to Mermaid and came across this while looking to do the same thing. It's disheartening to know that it used to work but doesn't now.

@MichaelTiemannOSC
Copy link

I'm not surprised that HTML tags don't work, but am surprised that markdown inside graph labels doesn't work.

@LuisBL
Copy link

LuisBL commented Dec 3, 2022

any answer on this ?

@ggriffinn
Copy link

ping

@avdata99
Copy link

pong

@DonSmilo
Copy link

This is very unfortunate

@vzakharov
Copy link

just adding mine to the voices

@morscher-m
Copy link

Same here

@DavidAntliff
Copy link

DavidAntliff commented Mar 13, 2023

It would be very useful to have mono-formatted text (i.e. back-ticked markdown like this) working throughout mermaid, especially since it's commonly used to document code-related subjects.

(rendering via v9.4.0)

@klausk-vipaso
Copy link

Same here. Also would be interested in having the possibility to declare code text within messages as @DavidAntliff suggested.

@pseidemann
Copy link

hi @jgreywolf,
any chance this can get promoted to Type: Enhancement?

@LuisBL
Copy link

LuisBL commented Mar 23, 2023

yes please promote

@jgreywolf
Copy link
Contributor

Done. Will also research a bit why support ended

@luftlight
Copy link

I've recently found success through enabling htmlLabels, something like %%{ init: {'theme': 'dark', "graph": {"htmlLabels": true}} }%%

@jxu
Copy link

jxu commented May 1, 2023

Interestingly <b> tags appear to work for flowcharts, at least within nodes with text. Or using markdown strings

@ckhiu
Copy link

ckhiu commented Apr 9, 2024

I would also like this feature

@ckhiu
Copy link

ckhiu commented Apr 16, 2024

I've recently found success through enabling htmlLabels, something like %%{ init: {'theme': 'dark', "graph": {"htmlLabels": true}} }%%

is this still working for you? Does not work for me with <b> tags in notes...

@IainDavis
Copy link

IainDavis commented Apr 18, 2024

I'd like to just add on here that if Mermaid is going to support html in sequence diagrams (or other places), it would be extraordinarily useful to be able to wrap a block of text in a <div/> and set the width with styles, rather than having to litter my text with manual <br/> tags. Keeping the line-breaks up to date while your text is changing is definitely a pain point.

@mohitpandey92
Copy link

It worked for me while creating bold and italics text within Mermaid diagrams in Notion. Hope this helps

flowchart LR
A-->I(<i>in silico</i> hypothesis generation)

@heindel
Copy link

heindel commented Jul 25, 2024

The simple wish is to have the possibility to

  • have the messages that are sent between participants not only plain text, but
  • contain at least some markdown markup possibilities, like e.g., in nodes of flowcharts.

This idea seems to be around for a while, e.g. here 6ffe9c8

@mantriyogesh
Copy link

This would be helpful in sequence diagram.

@schadenn schadenn linked a pull request Aug 9, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.