Mobile hyphen `-` doesn't work in mermaid

Steps to reproduce

Source Mode


Live Preview Mode / Reading Mode

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Mobile hyphen should also work in Mermaid

Actual result

Mobile hyphen doesn’t work in Mermaid

Environment

SYSTEM INFO:
Operating system: ios 18.0 (Apple iPhone12,1)
Obsidian version: 1.7.3 (166)
API version: v1.7.3
Login status: logged in
Language: en
Catalyst license: supporter
Live preview: on
Base theme: light
Community theme: none
Snippets enabled: 20
Restricted mode: off
Plugins installed: 28
Plugins enabled: 17
1: Tag Wrangler v0.6.1
2: Recent Files v1.6.0
3: QuickAdd v1.11.1
4: List Callouts v1.2.9
5: Advanced URI v1.44.1
6: Copy Block Link v1.0.4
7: Commander v0.5.1
8: Checklist v2.2.13
9: Calendar v1.5.10
10: Blockquote Levels v1.1.0
11: Dataview v0.5.67
12: Excalidraw v2.5.0
13: Plugin Update Tracker v1.5.2
14: Omnivore v1.10.4
15: Admonition v10.3.2
16: Highlightr v1.2.2
17: File Explorer Note Count v1.2.2

Additional information

I did try to turn on restricted mode and tested from Macbook Pro 2019 running the latest MacOS Sequoia 15.0, but it still doesn’t work.

iOS could be replacing the dash/hyphen (-) with an En dash (–) or Em dash (—) when you type the first two --.

It looks like an En dash and a dash in your iPhone screenshot ( –- ), but my eyes could be playing tricks on me.

I’d check the iOS keyboard settings to see what’s set in there.

If so, can we make edit that the en or em dash also works in Mermaid ?
It would be useful to use Mermaid on iPhone as well.

From my quick tests, it works without issues if you toggle off the keyboard setting Intelligent punctuation (or similar :sweat_smile: … Sorry, my phone isn’t in English) in iPhone's settings > General > Keyboards :blush:

…or, if you write the mermaid code block somewhat in reverse by typing first --> within the code block and then add what’s you need around the --> :sweat_smile:

2 Likes

THanks ariehen and Pch for understanding what was going on!

1 Like

Thanks! Smart Punctuation is not that smart at all :))

1 Like

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