notaapp / talk

Issues and discussions for the notes app, Nota.
https://nota.md
59 stars 1 forks source link

[Feature Request] Allow linking to Finder (or folders) #406

Open Overload119 opened 1 year ago

Overload119 commented 1 year ago

In a note I want to Cmd+Click a link to open a Finder window to that folder.

It seems to work in this case:

[View in Finder >](/Users/amirsharif/Dropbox/Documentation/Homes/My%20Folder/)

But not in this one:

[View in Finder >](/Users/amirsharif/Dropbox/Documentation/Homes/My Folder/)

It seems the encoding is only relevant to the spaces so there's no automatic way to do this.

astoilkov commented 1 year ago

Do I understand that you want the link to work without the need to write %20 instead of space in the link?

The markdown syntax specification writes that URLs should be encoded. See the example here.

Overload119 commented 1 year ago

I don't think it's natural to know that %20 is a space, so it's not easy to link to a directory.

If you drag and drop a folder, it tries to load it into Nota.

If you try to use a paste hook or have a command, most tools will encode the whole thing:

encodeURIComponent('(/Users/amirsharif/Dropbox/Documentation/Homes/My Folder/)')
// => '(%2FUsers%2Famirsharif%2FDropbox%2FDocumentation%2FHomes%2FMy%20Folder%2F)'

Maybe the solution is to support when the full link is encoded (which doesn't work today it seems).

[test](Users%2Famirsharif%2FDropbox%2FDocumentation%2FHomes%2FMy%20Folder)

Is not clickable.

astoilkov commented 1 year ago

Have you tried encodeURI? This will produce /Users/amirsharif/Dropbox/Documentation/Homes/My%20Folder/ and it might work.