Mermaid "/links" for non-english characters

The new internal-link feature is amazing, with @koala and @argentum we realized in discord that it has a problem with non-english characters

I have a similar set up to @ryanjamurphy he wrote about special symbols in file names here

Here’s an example of a mermaid diagram using the correct syntax with

```mermaid

(discourse doesn’t display it below, but it’s there in obsidian

graph LR;
A-->C;
B-->C;

class A internal-link;
class B internal-link;
class C internal-link;

click A "/⨳ mermaid test 1"
click B "/mermaid test 2"
click C "/mermaid test 3"

As you can see click A "/⨳ mermaid test 1" has a special symbol, in this case the symbol.

click B "/mermaid test 2"
and
click C "/mermaid test 3" both work without any issues, since they don’t have any special characaters.

I’d be amazing to have Obsidian read non-english characters, which would benefit users like me who use special symbols, as well as those of us who write notes in other languages.


in this case I make use of these type of symbols to describe the different types of note by filename, they are usually unicode symbols taken from here.


I understand if this is a mermaid limitation, in which case we could workaround by using URI links, (in my case, with linux, the set-up is less than ideal, but that’s linux’s not obsidian’s fault) and still a doable solution.

but it’d be awesome if this could be achieved in Obsidian if possible with the great new feature of “/links” in mermaid.

it’d be still great even if these codes need to be converted with something like url encoder which as mentioned by @koala in discord doesn’t currently work.

Thanks!

4 Likes

For reference see the messages on discord here. (insider-build channel)
There are pictures that show the process in detail.

2 Likes

This works in the newest Insider build now! (at least with non-English characters, I haven’t tried it with the @santi uses though.)
@WhiteNoise This thread should be closed.
Sorry for pinging you, I realised too late that this is already in the feature archive.

1 Like

thanks for the update @koala I’ll give it a try with characters like ⨳

1 Like

I really like how clean it is to create internal links!

Unfortunatly, these special non-english characters don’t work yet

This simple version works

graph TD;
  A[Test 1]
  B[Test 2]
  C[Test 3]
  A --> B
  B --> C
  class A,B,C internal-link;

This one with special characters (⨳ Test 4) doesn’t work

graph TD;
  A[Test 1]
  B[Test 2]
  C[Test 3]
  D[⨳ Test 4]
  A --> B
  B --> C
  C --> D
  class A,B,C,D internal-link;

It returns this error unfortunatly

Error parsing Mermaid diagram!

Lexical error on line 5. Unrecognized text.
... 2]  C[Test 3]  D[⨳ Test 4]  A --> B
---------------------^

If these special characters worked in this format, that’d be amazing

Hopefully it’s possible, since the simplicity of these internal links is excellent so far

@santi
It works.
grafik

What you forgot are the double quotes Mermaid needs for special characters.
Documentation on Special characters that break syntax

graph TD;
  A[Test 1]
  B[Test 2]
  C[Test 3]
  D["⨳ Test 4"]
  A --> B
  B --> C
  C --> D
  class A,B,C,D internal-link;
1 Like

ohh woww! thank you @koala I can’t beleive I missed that.
This just made my day, it works perfectly, thanks to the devs for making this happen, it’s amazing!

1 Like