Markdown image links failing for filenames with whitespace

Steps to reproduce

  1. Store an image named foobar.png in the root of a vault or in the attachment folder.
  2. Store an im named foo bar.png next to the first image.
  3. Put a link to the first image in a page like that: ![](foobar.png)
  4. Put a link to the second image in a page like that: ![](foo bar.png)
  5. Put a link to the second image in a page like this: ![[foo bar.png]]

Expected result

All images should be displayed.

Obsidian understands Markdown image link syntax but fails to process filenames including spaces. However, such filenames are not considered invalid in general, because they are processed correctly when using the Obsidian image link syntax.

Also Obsidian stores images automatically with spaces in filenames, eg. Pasted image.png. Hence it’s to be expected that they should work in all cases.

Actual result

Only images linked to in steps 3 and 5 are shown. Image from step 4 is missing.

Environment

  • Operating system:

MacOS

  • Obsidian version:

0.6.4

  • Using custom CSS:

Additional information

3 Likes

This is the correct behaviour. If you use the standard MD syntax then you should also substitute whitespaces with %20.

![](foo%20bar.png)

Did not know that. Sorry.

I was just comparing Obsidian’s behavior with that of e.g. Typora or MacDown: both of which don’t have a problem with spaces in image links.

It’s simply convenient to have a software take care of such details where the solution is so simple.

4 Likes