Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vault not found if using the URI from another vault #186

Closed
IanElsinga opened this issue Aug 29, 2024 · 4 comments
Closed

Vault not found if using the URI from another vault #186

IanElsinga opened this issue Aug 29, 2024 · 4 comments

Comments

@IanElsinga
Copy link

If a link is created using the vault name and that link is pasted in another vault, the link will not work. It says cannot find a vault.... It does work if run from outside Obsidian, from a windows run prompt for example.

If a link is created using the vault ID instead of the name, then the links work in both cases.

Can you or do you support using vault names in the link when clicking it from another Obsidian vault?

@Vinzent03
Copy link
Owner

The plugin doesn't handle the vault parameter at all. That's handled by Obsidian. Please try the same with the default Obsidian URI. If the issue persists, please open a bug report in the Obsidian forum.

@IanElsinga
Copy link
Author

IanElsinga commented Aug 29, 2024

Thanks for the quick reply, @Vinzent03.
I did try with the default Obsidian link which contains the vault name (not ID), and that works fine from a different vault. But I see what's happening. The following manually adjusted link works from vault to vault:

obsidian://adv-uri?vault=Powertranz%20Docs&filepath=Docs%2FRecurring.md&heading=Hookdeck

However, when I choose Advanced URI: Copy URI for current file from the command pallet, it puts this in my clipboard, which doesn't work:

obsidian://adv-uri?vault=Powertranz Docs&filepath=Docs%2FRecurring.md&heading=Hookdeck

So it's only an issue with vault names containing spaces: the Advanced URI copy isn't replacing them with %20.

I don't know typescript, but perhaps this will fix it in line 84 of tools.ts:
suffix += this.app.vault.getName().replace(" ","%20");

@Vinzent03
Copy link
Owner

Thanks for the investigation. Should be fixed now.

@IanElsinga
Copy link
Author

Works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants