glushchenko / fsnotes

Notes manager for macOS/iOS
https://fsnot.es
MIT License
6.44k stars 473 forks source link

No links to pages with + in the title #1390

Closed tewe closed 1 year ago

tewe commented 2 years ago

Description

File > Copy URL does not properly escape note titles. Plus signs are left as is instead of becoming %2B.

When opening a fsnotes://find?id= URL, plus signs are unescaped into whitespace (as they should), causing the titles not to match and the note not to be shown.

To Reproduce

  1. New note
  2. Rename note to something with a plus sign (e.g. 201227 223904+0100, which is my personal date format for diary entries, and includes a timezone)
  3. Copy URL
  4. Open some other note
  5. Open that URL

The search field will show 201227 223904 0100 (no +) and the results will include the note create above, but it will not be opened (you'll still see the content of where you went in step 4).

Expected behavior

The note for which we copied the URL is shown.

FSNotes version

5.4.5

macOS/iOS version

macOS 12.5

Additional context

When creating the URL, addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) seems wrong. The title becomes part of the query string, not the host.

Unfortunately urlQueryAllowed won't work, either, because it contains characters allowed in the whole query string, where we need just a single query parameter. So you'll need to roll your own.

tewe commented 2 years ago

This also affects [[double square bracket links]], because they use a URL internally.

glushchenko commented 1 year ago

Release available for download here https://github.com/glushchenko/fsnotes/releases/tag/6.0.0

I also ask you to vote on Prouct Hunt and Reddit, it will help in spreading:

https://www.producthunt.com/posts/fsnotes-6 https://www.reddit.com/r/macapps/comments/yh8156/fsnotes_v6_pro_notes_manager_for_macos/

Thanks!

tewe commented 1 year ago

Copy URL now works for me. Clicking [[201227 223904+0100]] still does not.

glushchenko commented 1 year ago

https://github.com/glushchenko/fsnotes/releases/download/6.0.1/FSNotes_6.0.1.zip

tewe commented 1 year ago

Internal links with plus signs work for me. Thanks!