Cannot create note by clicking link if it contains slashes

Consider Vault/Folder/MyNote.md

That has the following content

[[ChildFolder/LinkedNote]]

by clicking on that link, the note is created under Vault/ChildFolder/LinkedNote.md instead of Vault/Folder/ChildFolder/LinkedNote.md as expected

[[../SiblingFolder/LinkedNote]]

By clicking on this link, nothing is created and the error is writen in the console

Folder already exists.

And corresponding Notice is shown.

The same issue is happening with corresponding markdown link.

I don’t know the correct way to debug Obsidian internals so I just unminified the sources and found the problematic place

case 2:
    return u = null,
    o.contains("/") || (u = i.fileManager.getNewFileParent(t)),
    [4, i.fileManager.createNewMarkdownFile(u, o)];

I think the fix has to be to remove the part

o.contains("/")

because it causes the problem in this code

No, (you may not like it but) this is correct.

regarding

[[../SiblingFolder/LinkedNote]]

Also this:

https://forum.obsidian.md/t/in-relative-path-mode-always-add-in-front-of-links-for-files-in-subdirectories-relative-to-the-current-file/25063

This is a very surprising behavior. It doesn’t respect New link format setting in Obsidian. Obsidian’s current implementation makes sense (to me) only if that setting is set to Absolute path in vault.

Overall this question is debatable. I could not find any mentions of relative paths in Wikipedia Wikilink specification Help:Link - Wikipedia

But I think that is because in Wikipedia they don’t have a concept of folders so essentially all their “notes” reside in the same folder so they never have this problem.

I am curious to know where is your design decision regarding rooted wikilinks came from. Are you trying to be compatible with some other product’s wikilink implementation?

And even if we stop discussing wikilinks, regular markdown links creation doesn’t work as expected

Consider Vault/Folder/MyNote.md

[just link](ChildFolder/LinkedNote.md)
[starting with dot](./ChildFolder/LinkedNote2.md)
[does not work at all](../SiblingFolder/LinkedNote2.md)

by clicking on the first link, the note is created under Vault/ChildFolder/LinkedNote.md instead of Vault/Folder/ChildFolder/LinkedNote.md as expected

Second link has the same flaw but it even worse because now it is very obvious that the relative link was meant there.

And third link has the same Folder already exists error.

P.S.
I am a software developer myself and I like Obsidian very much. If your team can find any of my development help useful, I am ready to help voluntarily

1 Like

Links are absolute paths relative to the vault root without the leading slash.

There is a feature request and bug reports open for your other two cases. Follow those.

I understand that links are relative to the root. I just asked what is the reasoning for that. As in HTML all links are relative unless they start with slash. I am curious to see why do you make that design decision

1 Like

We have a fraction of users using nested vaults. It will break their use case.

Would you at least consider to have a setting to make links relative? For those who rely on current behavior, they just won’t set it

I understand your preferences. Feel free to open a FR about it.