Mermaid - how to add a picture to a graph node

I would like to add a photo to the graph in Mermaid.

  1. Photo available on the internet.
  2. A photo located on the computer:
    2.1. In Obsidian in the notes folder where the graph is
    2.2 In the Obsidian in the media folder
    2.3. In a folder other than Obsidian.

The 2.1, 2.2, 2.3 syntax posted below does not work.

What am I doing wrong?

  1. I found the syntax
graph TD;
A[(<img src='https://icon-library.com/images/small-icon-png/small-icon-png-6.jpg' width='40', height='40' />)]
B-->C

But it doesn’t always work. I don’t know why yet. Is there any other way?

2.1. In Obsidian in the notes folder where the graph is

graph TD;
A[<img src='OK.jpg' width='40' height='40' />]
B-->C

2.2 In the Obsidian in the media folder

graph TD;
A[<img src='file:///C:/Users/ABC/Desktop/Obsidian/Box_01/Multi_Media/OK.jpg' width='40' height='40' />];
B-->C

2.3. in a folder other than Obsidian.

graph TD;
A[<img src='file:///C:/Users/ABC/Desktop/Test/OK.jpg' width='40' height='40' />];
B-->C
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.