dpradov / keynote-nf

Tabbed notebook with RichText editor, multi-level notes and strong encryption.
Mozilla Public License 2.0
241 stars 56 forks source link

Content after a BLANK space will not be regarded as part of the URL #678

Closed 000forest closed 2 months ago

000forest commented 2 months ago

When typing URL in note, all the content after a BLANK space will not be regarded as part of the URL. For example, when typing a URL like "https://aaa.bbb.ccc/hello world", it will be recognized as "https://aaa.bbb.ccc/hello". Is there any configuration missed by me or some intended behavior in current design?

Keynote-nf version: 1.9.2.01

Stefanoko commented 2 months ago

The fastest way is probably to simply type %20 instead of the blank space: https://aaa.bbb.ccc/hello%20world Or type your URL into the address bar of a browser first, as it is, with spaces and all. Then copy it from there and the %20 will be added automatically.

s427 commented 2 months ago

Yeah, a space character is considered unsafe to use in a URL. They are not forbidden and may work in some very specific contexts where there is no ambiguity (e.g. in a browser's address bar). But in most other contexts (e.g. in email clients, instant messaging, word processors, note taking apps, etc), a space is considered to mark the end of the URL. If you need to use a space in a URL in those contexts, you replaced it by %20.

Think of it this way: if a URL is included in a sentence (and followed by one or more words from that sentence), how can KeyNote "guess" where the URL ends?

"Visit https://aaa.bbb.ccc/hello world to check this cool stuff!"

-> If space were allowed, there is no way for KeyNote to tell where this URL actually ends.

"Visit https://aaa.bbb.ccc/hello%20world to check this cool stuff!"

-> No ambiguity.

Note how even the Github comment system works the same.

000forest commented 2 months ago

Thanks for the clarification and solution proposal with char "%20". Totally understood the sense of current implementation now.