Broken links in relative path mode on move/rename

In Relative-path mode,
relative links should be updated when:

  1. the linked file is moved (done!)
    AND
  2. the file that contains the link is moved (to-do!).

EDIT: Added minimal example:

Have foo.md and bar.md in the root of the vault.
With foo.md containing [[bar]]

move foo.md to /subdir

  • Expected foo.md content:
    [[../bar]]
  • Actual
    [[bar]]
2 Likes

Please use the template when reporting bugs.

:wink::grimacing::face_with_hand_over_mouth:

2 Likes

I’m using a single vault attachment folder/relative path to file /MDlinks so embedded images will still work with most MD editors like Typora or when synced in Github when I want to read my notes on my phone. However, I tend to move notes around in the vault across different folders (ex. Inbox folder first, then to Project1 folder). This breaks the links for the embedded image files since links are not automatically updated.

Settings:
Automatically Update Internal links: On
New link format: Relative path to file
Use [[Wikilinks]]: Off
Default Extension for file attachments: In the folder specified below
Attachment Folder Path: attachments

Steps to reproduce

  1. Make a new note in root vault directory
  2. Insert screenshot in note:
    ![](attachments/Pasted%20image%2020210302020308.png)
    This is compatible with most MD editors and image renders fine when viewed in Github.
  3. Move note inside a folder in the vault (e.g., Vault/Test). The link to the embedded image is not automatically updated

Expected result

embedded image link will be updated to ![](../attachments/Pasted%20image%2020210302020308.png)

Actual result

link stays the same:
![](attachments/Pasted%20image%2020210302020308.png)
This renders fine with in Obsidian but broken in other MD editors or when viewed in Github.

Environment

  • Operating system: macOS 11.2.1
  • Obsidian version: 11.4

Additional information

I’m on 0.11.13 and can confirm that this bug still exists – when the file that contains the link is moved, the links (relative paths) won’t be updated.

Hi I was wondering if this is planned to be fixed in the near future?

Relative path is how these markdown files can play nicely with other programs, which I think is important as local first & plain files are what Obsidian advertises itself. With this renaming function broken, it really generates a lot of hesitation/fear despite that the links will still work within Obsidian while the relative paths are incorrect…

1 Like