Quantcast
Channel: Whitespace in image paths
Viewing all articles
Browse latest Browse all 20

Whitespace in image paths

$
0
0

No, both of those are absolute urls. If you have a protocol in the url, it’s absolute.

(More generally, a file/http/https url consists of a protocol, a domain, a path, a query, and a hash. You can omit any set of these starting from the beginning; including one means the following ones are automatically included, even if you’re “including” an empty value for them.)

Windows drive letters are extra weird wrt file urls, which is why you can’t start a link with them. You can definitely use relative urls for any part of the path below the drive letter, though.

As @PhilippeG said, spaces aren’t valid in URLs. Browsers allow them in a lot of circumstances, but CommonMark doesn’t recognize them as part of the url grammar for anything but angle-bracket links, as @jgm says. You can percent-encode the space, as you discovered, or hex-encode it; both will work. Bare percentages should be escaped in a url (as %25, or a hex entity), but again, browsers allow it as long as it doesn’t look like a hex escape (isn’t followed by two hex digits).

Read full topic


Viewing all articles
Browse latest Browse all 20

Trending Articles