No links to pages with + in the title
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
- New note
- 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) - Copy URL
- Open some other note
- 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.
This also affects [[double square bracket links]], because they use a URL internally.
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!
Copy URL now works for me. Clicking [[201227 223904+0100]] still does not.
https://github.com/glushchenko/fsnotes/releases/download/6.0.1/FSNotes_6.0.1.zip
Internal links with plus signs work for me. Thanks!