Button tag with URI crashes on mobile

Steps to reproduce

Paste this code into the note. This is a button that links to Obsidian’s URI to open a specific note. You will need to replace vault and file values in the URI. It works on desktop with the note opening. It will crash on mobile (iOS).

<a href="obsidian://open?vault=My%20Vault&file=myFileName"><button>Open note</button></a>

Did you follow the troubleshooting guide? Y

Expected result

The note that is in the URI should open on mobile and desktop.

Actual result

The note opens fine on desktop, but crashes on mobile.

Environment

SYSTEM INFO:
	Operating system: ios 18.1.1 (Apple iPhone16,2)
	Obsidian version: 1.7.7 (172)
	API version: v1.7.7
	Login status: not logged in
	Language: en
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 2
	Restricted mode: on

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.


Additional information

does it need to be html button? what if you just use the link?

Just tried on iOS v18.2b4 and Obsidian v1.7.7.

Clicking the “Open note” button opens the target note as expected for me. No crash.

update: I’ll just add that the button/link and target note are in the same vault from my test above.

If I put the button/link in another vault, it will open the target vault but only open whatever note was last open in that vault. Still no crash though.

1 Like

Not including the html button yields the same result. It works on desktop yet crashes on mobile.

Thanks Ariehen. Your comment made me realize that this happens when the vault name doesn’t exist, so when I correct the vault name it works on mobile. I forgot that my desktop vault name is different than my mobile vault. I would suggest that it should show an error instead of it crashing the app.

I know this isn’t pertaining to the original BR, but clicking on such a button to open a new note drops the cursor halfway though the file and sometimes selects texts, especially if the button is placed halfway a different file. Should I create a new BR for this?