mjbvz / vscode-markdown-mermaid

Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
MIT License
648 stars 119 forks source link

HTML support for node text #96

Closed jmutchek-msft closed 2 years ago

jmutchek-msft commented 3 years ago

I have seen several references online to people inserting html into node text (though I can't find anything in the mermaid docs about it) and it seems to work in the Live Editor. I haven't been able to get it to work with this previewer, however. For example,

:::mermaid
%%{init: { 'securityLevel': 'antiscript', 'flowchart': { 'htmlLabels':true } } }%%
graph LR
    id1(Start)-->id2(Mid)
    id2-->id3(<strong>End</strong>)
:::

image

Is the previewer enforcing a strict security level perhaps? Should this be possible and I just have the config wrong? Thanks.

Pindar777 commented 3 years ago

@jmutchek-msft Does the %%{init... has an effect on the output? How do you compile the code? I'm using markdown-all-in-one and cannot pass any config parameters...

mjbvz commented 2 years ago

This works for me in the most recent version (change to use underline instead of strong to make this more obvious):

Screen Shot 2022-05-17 at 11 54 05 AM