Support anchors in file:/// URIs

Use case or problem

I’d like to link to local files, especially PDFs. As it seems, in some Operating Systems it is possible to create file:// -URIs which point to a file within the local file system and adding #page= to it this opens the PDF on the given page number.

However, Obsidian seems to parse the file:// URI incorrectly and ignores it, when it contains # .

Proposed solution

Adapt local file URL parser to allow # and forward to operating system.

Current workaround (optional)

You can copy the URL and paste it into a web browser, this opens the local PDF to the given page number.

On a Mac you can for instance copy the pathname using opt-right-click and “Copy … as pathname”. Prefix that with file::// and append #page=10 and open the resulting URL in your favourite browser.

E.g. file:///Users/x/Desktop/pdf.pdf#page=20