simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.02k stars 132 forks source link

How to include a mermaid chart containing href tag in markdown #173

Closed ghost closed 1 year ago

ghost commented 2 years ago

Hi, thanks to this extension, I can create a chart using mermaid. The next step is to make a chart contain links to navigate to different urls. Right now, it looks like this

Problem

The corresponding code is this Code

It seems easy but just got stuck in this. Any ideas to help me out?

simov commented 2 years ago

Not sure tbh, I was able to reproduce it:

graph TD
  A[This is an important <a href='https://google.com'>click me</a>]
ghost commented 2 years ago

Maybe more detailed info. Those lines are in a local markdown file and chrome with this extension is used to open it. I can't add link in mermaid graph. If in mermaid itself, it works. I don't know whether this will make any difference to you.

ghost commented 2 years ago

Find something here. https://mermaid-js.github.io/mermaid/#/usage?id=enabling-click-event-and-tags-in-nodes mermaid

Could I customize this security level to loose or select the version of mermaid in this extension?

simov commented 2 years ago

Sure, pull this repository and search for mermaid here: https://github.com/simov/markdown-viewer/blob/master/content/index.js

Follow the manual install instructions after that: https://github.com/simov/markdown-viewer#manual-install

simov commented 1 year ago

Mermaid got updated in the latest Markdown Viewer v5, you can download it from the Chrome Web Store or from the releases section here.