Space in link to file

Steps to reproduce

I enter the following text in the note
[Test](file:///"C:\TEMP\test 1.txt")

Expected result

I see it in the preview
`Test

Actual result

I see it in the preview
[Test](file:///"C:\TEMP\test 1.txt")

Environment

  • Operating system: Windows 10.0.19041
  • Obsidian version: 0.9.11

Additional information

@Vadych, you are not using a proper URL. You need to remove the quotes, use forward slashes and replace the space with %20, like this:

[Test](file:///C:/TEMP/test%201.txt)

See also here in the Wikipedia.

as cito said, that’s not the right format.
You can also yuse

[test](<file:///C:/TEMP/test 1.txt>)

2 Likes

The same problems with
‘[Test](file:///C:\TEMP\test 1.txt)’
In Windows, you can use \

@Vadich Both forward and backslashes will work on Windows, but the backslashes may not work with some other Markdown editors which may require valid file URIs. When you use the syntax suggested by @WhiteNoise with the angle brackets, you do not need to escape the space chars, otherwise you need to replace them with %20.

When you use the syntax suggested by @WhiteNoise with the angle brackets, you do not need to escape the space chars, otherwise you need to replace them with %20.

I know this, but having to manually edit the path is very frustrating for me.
I think this is a bug

It is not a bug, this is the way URLs work and is documented. It can, however, be a « quality of life » feature request (and I would second that).

2 Likes

I tried changing \ to /
The problem with space remains

Yes, it would be nice if Obsidian would be more accommodating regarding Windows file paths.

Following up on this: This solution has been mentioned in a couple of threads and while this does create a link (meaning it hides the path and appears to make the text clickable), it doesn’t actually open the link on click. Am I doing something wrong?

EDIT: forgot about the “file:///” part, works fine now, apologies