# Cannot create note by clicking link if it contains slashes

**URL:** <https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071>\
**Category:** Bug graveyard\
**Created:** [April 18, 2022, 7:16pm UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071 "2022-04-18T19:16:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnaoumov](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnaoumov/32/22325_2.png) [@mnaoumov](https://forum.obsidian.md/u/mnaoumov)\
**Post date:** [April 18, 2022, 7:16pm UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/1 "2022-04-18T19:16:01Z")

</div>

Consider `Vault/Folder/MyNote.md`

That has the following content

```nohighlight
[[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

```nohighlight
[[../SiblingFolder/LinkedNote]]

```

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

```auto
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

```nohighlight
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

```nohighlight
o.contains("/")

```

because it causes the problem in this code

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 18, 2022, 8:44pm UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/2 "2022-04-18T20:44:41Z")

</div>

> [@mnaoumov](#):
>
> by clicking on that link, the note is created under `Vault/ChildFolder/LinkedNote.md` instead of `Vault/Folder/ChildFolder/LinkedNote.md` as expected

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

regarding

`[[../SiblingFolder/LinkedNote]]`

> [@Obsidian has trouble creating new notes from "Relative path to file" links](https://forum.obsidian.md/t/obsidian-has-trouble-creating-new-notes-from-relative-path-to-file-links/3741):
>
> Steps to reproduce Set “New link format” in File preferences to “Relative path to file.” Create a new link with a relative format (this has to be done manually, as the file doesn’t exist yet so Obsidian can’t guess your desired folder path. E.g., ../Calendar/20200803 Try to create a new note from the link Cry Expected result Successful creation of the new file in the expected directory. Actual result An ENOENT error. Environment Operating system: macOS 10.15 Obsidian version: 0.…

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](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)

---

<div class="post-metadata">

**Author:** ![mnaoumov](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnaoumov/32/22325_2.png) [@mnaoumov](https://forum.obsidian.md/u/mnaoumov)\
**Post date:** [April 19, 2022, 10:28pm UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/3 "2022-04-19T22:28:41Z")

</div>

> [@WhiteNoise](#):
>
> No, (you may not like it but) this is correct.

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](https://en.wikipedia.org/wiki/Help:Link#Wikilinks_(internal_links))

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`

```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

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 20, 2022, 12:16am UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/4 "2022-04-20T00:16:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mnaoumov](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnaoumov/32/22325_2.png) [@mnaoumov](https://forum.obsidian.md/u/mnaoumov)\
**Post date:** [April 20, 2022, 12:18am UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/5 "2022-04-20T00:18:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 20, 2022, 12:29am UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/6 "2022-04-20T00:29:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mnaoumov](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnaoumov/32/22325_2.png) [@mnaoumov](https://forum.obsidian.md/u/mnaoumov)\
**Post date:** [April 20, 2022, 12:37am UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/7 "2022-04-20T00:37:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [April 20, 2022, 12:38am UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/8 "2022-04-20T00:38:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [October 13, 2022, 2:54pm UTC](https://forum.obsidian.md/t/cannot-create-note-by-clicking-link-if-it-contains-slashes/36071/9 "2022-10-13T14:54:51Z")

</div>

Archived on October 13, 2022, 2:54pm UTC


