PDF File with a hashtag (#) in the name

Someone sent me a PDF file with a hashtag/number sign as part of the file name. (e.g. Fiscal Year 2023 #2 Summary of Activity.pdf).

When I dragged the PDF into a note, it created a link to the file as expected, but clicking the link just opened a new, blank note. After a lot of messing around, I discovered that removing the # from the file name resolved the issue.

Is this a bug, something I’m not understanding, or is there an easier way to work around this in future? Hopefully people stop putting #'s in their file names.

If you click into the file name to rename a file and enter a # it gives you a red warning pop up telling you that file names can’t include that:
image

I’m not a programmer, but I’m pretty sure that’s because Obsidian uses #s, ^s and []s for its internal linking.
If you have a file link in your note, [[today's news, Dec 01]] then you can add a # to link to particular headings, [[today's news, Dec 01#Good News]]. Or you can use a ^ to link to a particular paragraph, which lets you select a paragraph in the dropdown menu and then gives that specific paragraph a descriptor, e.g. [[today's news, Dec 01^7u182o3]] and then you can navigate straight to that text block.

Meaning that using any of these characters in filenames would break this functionality so Obsidian just won’t let you do it from the get go.

3 Likes