Add settings to control link resolution mode

Use case or problem

Consider vault with the following files

A.md

Absolute path resolved A

Folder/A.md

Relative path resolved A

Folder/B.md

Wikilink [[A]] resolves to the root `A.md` rather than to the relative one `Folder/A.md`

Same issue with the markdown link [A](A.md)

Originally, I raised this is as a bug but later on I was told it is an intentional behavior.

By its nature, markdown was built to use relative paths. The users who want to maintain the maximum portability of the vault, usually disable Use [[Wikilinks]] Obsidian setting and switch New link format setting to Relative path to file. This makes possible to comfortably edit your notes in any markdown editor.

Current behavior of Obsidian link resolving differs from the way markdown editors work. I checked in Visual Studio Code and in Typora. There if you follow the markdown links from Folder/B.md they will redirect to Folder/A.md unlike current Obsidian’s behavior.

While it is understandable why did Obsidian make this design choice, I think it would be very handy if we can alter the default behavior via some setting.

Proposed solution

Add Link resolution mode setting to Obsidian: with the following options

  • Absolute path first, fallback to relative path (Default)
  • Relative path first, fallback to absolute path
  • Absolute path only
  • Relative path only

Current workaround (optional)

There exists a workaround to explicitly specify the type of the links

[[/A|A]] and [A](/A.md) resolve as absolute link path

[[./A|A]] and [A](./A.md) resolve as relative link path

However such workaround has its own issues, and it’s better for it to be addressed on the Obsidian dev level

Related feature requests (optional)