56

In this answer the need arose to include the URL http://www.c64-wiki.com/index.php/CHR$. I put it directly in the text without any brackets. I knew there was a chance of that dollar sign being a problem, so I verified that it worked in the preview before posting. It worked, so I posted it like that.

Unlike the preview, the real post contained a broken link. It pointed to .../CHR with the dollar sign not being part of it. When I noticed this I edited the post to use %24

It would be nice if the preview and the actual post renderer would agree on what constitutes a URL.

1

1 Answer 1

6

TL;DR version: it's a really bad idea to use URLs that are not delimited by <>, but people keep messing this up

This is what happpens when independent bits of software try to handle URLs without following the standard, RFC 1738.

In particular:

  • URLs are surrounded like <url> in free text (page 3); "url" is also mentioned. If it's not surrounded, it's only a sequence of characters that sort of looks like a URL.

  • ASCII Space, all ASCII C0 control characters, DEL, and all characters with the 8th bit set must be escaped (though for the last, it is defensible to allow UTF-8 these days, there might be a standard somewhere?).

  • The only unsafe-in-all-urls characters are:

    <>"%{}|\^~[]`#

  • The only unsafe-within-some-schemes characters are:

    ;/?:@=&

  • The remaining special characters, and all ascii alphanumerics, never need to be escaped in a compliant system:

    $-_.+!*'(),

Ergo, this is a bug in markdown, likely caused by trying to auto-link http://looks_like_a_url_but_really_not instead of only linking <http://actually_a_url_because_it's_delimited>. Additionally, the fundamental choice of () for [link text](url) is noncompliant, and a major cause of bugs.

3
  • 5
    I'm guessing markdown was going for human usability, rather than adherence to a spec, and hence why it recognizes URLs without surrounding delimiters. I mean, most humans don't put delimiters around URLs when they write them.
    – GreenGiant
    Commented Dec 8, 2014 at 20:55
  • 2
    @GreenGiant I don't think the Markdown standard actually says anything about automatically detecting links. It's not really a function of the markup, anyway. It's just something StackOverflow implemented as a convenience.
    – jpmc26
    Commented Dec 8, 2014 at 22:29
  • 2
    $-_.+!*'(), are ASCII, but there are not alphanumeric! "Alphanumeric" means "numbers and letters".
    – jpmc26
    Commented Dec 8, 2014 at 22:32

You must log in to answer this question.