Support Internal links with markdown angle bracket syntax (especially rename)

Steps to reproduce

Suppose there is a file, which contains space in it’s file name: demo image.png

The first standard way to insert a file who’s name has space could be:

![Image](assets/demo%20%image.png)

In this condition, with the right click, we can rename it directly:

The second way to insert it is more intuitive:

![Image](<assets/demo image.png>)

Obsidian can correctly preview it, but, with the right click, the renaming function disappeared:

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.12.4

Additional information

4 Likes

Steps to reproduce

In the editor, write down the following embedded links:

some text

![Beautiful image](assets/A%20beautiful%20image.png)

![Beautiful image](<assets/A beautiful image.png>)

Make sure you have the assets/A beautiful image.png file relative to the note.

And then right click on the first link, rename it to My dear daughter.png, and update links

Expected result

The content should become like this:

some text

![Beautiful image](assets/My%20dear%20daughter.png)

![Beautiful image](<assets/My dear daughter.png>)

Actual result

The content will actually become to this:

some text

![Beautiful image](assets/My%20dear%20daughter.png)

![Beautiful image](assets/My%20dear%20daughter.png beautiful image.png>)

The second link is totally damaged.

Environment

  • Operating system: Windows10
  • Obsidian version: 0.12.4

Additional information

I know, some guys will say:

Why you’d use ![Beautiful image](<assets/A beautiful image.png>) that kind of strange syntax? It is not a correct syntax!

Actually, it is ==a correct and beautiful markdown syntax==, you can find it at CommonMark Spec Example 486, it’s explain is:

The destination can only contain spaces if it is enclosed in pointy brackets

It’s kind of surprising me that few people know this syntax, and even some other developers don’t know that too!

Next, what is the reason to use this syntax? Well, mainly because it’s intuitive, tidy, beautiful, and commonly supported by other Markdown editors.

You can compare these examples:

![Beautiful image](assets/A%20beautiful%20image.png)
![Beautiful image](<assets/A beautiful image.png>)

![My dear daughter](assets/My%20dear%20daughter.png)
![My dear daughter](<assets/My dear daughter.png>)

![One file](assets/A%20long%20file%20name%20with%20spaces%20in%20it.pdf)
![One file](<assets/A long file name with spaces in it.pdf>)

The pointy bracket way is more intuitive! And more importantly, it is compatible with most Markdown editors, since this syntax is a part of the Commonmark Spec.

Expected enhancement

  • Repair the updating link bug to the pointy bracket syntax
  • When using Markdown links, inserting a file whose name have spaces, use the pointy bracket instead of replacing spaces into %20
1 Like

I’ve also had problems with internal links using angle brackets, and more recently noticed it not working in edit mode with internet URLs.
It’s a shame, because some tools I use automatically use angled brackets (the Prettier formatter plugin for VSCode, and the Paste URL Obsidian plugin specifically). They are also just convenient and otherwise supported.

3 Likes

I know this topic was created more than 2 years ago but the bug remains active in the current version of Obsidian (1.4.16). Obsidian keeps mangling angle-bracketed file links on file renames despite otherwise supporting this standard CommonMark format. Percent encoded links are ugly, so please add this finishing touch to let us use a more user-friendly standard format, fix this bug.

4 Likes