4 ms·
Is there a character to demark the end of a url? If I write into my smartphone notes a url, I prefer to write something like: Http://google.com/search?q=How t
by kovek 6y ago
Is there a character to demark the end of a url?
If I write into my smartphone notes a url, I prefer to write something like:
Http://google.com/search?q=How to bake cakes$
Than
Http://google.com/search?q=How+to+bake+cakes
iOS Notes treats the second one as a URL and the first one partially as a URL
- yencabulator 6y agoAn old convention is <http://google.com/search?q=How+to+bake+cakes http://google.com/search?q=How+to+bake+cakes>. Really helps with ending periods. Markdown copied that too: https://spec.commonmark.org/0.29/#autolink https://spec.commonmark.org/0.29/#autolink
- kovek 6y agoThis worked in iOS notes!! <http://google.com/search?q=How http://google.com/search?q=How to bake cakes> Thank you!
- account42 6y agoURLs can't contain spaces
- gumby 6y agoActually they can, though it is not recommended as URLs appear in running text, which may break lines at space characters. Just look at appendices A and B of RFC 3986. Although it's recommended that you encode them in user representation (for this reason) you can certainly should be able to send a space character through at the protocol level and if not it's a bug. Note that a space is not valid in the host name portion if you are using DNS (which most URLs do, of course).
- account42 6y agoThe EBNF in appendix A does not allow any spaces. Specifically, there is also this section in RFC 3986. > 2.4.3. Excluded US-ASCII Characters > Although they are disallowed within the URI syntax, we include here a description of those US-ASCII characters that have been excluded and the reasons for their exclusion. [...] > space = <US-ASCII coded character 20 hexadecimal> You can certainly encode spaces in URLs but the URL will not contain spaces. The regular expression in appendix B is irrelevant because it assumes a well-formed URL so spaces do not need to be explicitly excluded. And at the protocol level you certainly can't use spaces in URLs (in HTTP 1.1) because the request line uses spaces to delimit the URL or path.