4

If you link to a URL with a port number, Markdown will eagerly percent-encode the colon the separates the host name from the port number. See this test message. The chat message I typed in looks like this:

[Test case for bug report about Morkdown](http://example.com:80/)

But the generated HTML (as shown by Chrome's DOM inspector) looks like this:

 <a href="http://example.com%3A80/" rel="nofollow">Test case for bug report about Morkdown</a>
10
  • 1
    I'm afraid I don't see the percent-encoding, just "example.com" as the link. You should consider including a screenshot too.
    – jmort253
    Dec 11, 2012 at 8:34
  • Click it, or look at it in the DOM. Thanks for the edit @Caleb. Dec 11, 2012 at 9:27
  • "click it" is browser-specific; even with the %-encoding, it works ok in Chrome; not an intentional behavior, though Dec 11, 2012 at 9:27
  • @MarcGravell: Same issue here, percent encoded seems to work fine in Chrome. (And even custom links specified as port 80 are being stripped by Chrome to be just the domain when followed). I guess the question is: is percent encoding compliant with whatever protocol spec it needs to be in this case?
    – Caleb
    Dec 11, 2012 at 9:31
  • 1
    @Marc ah, ok. FWIW, I am using Firefox, which does not fix it. Dec 11, 2012 at 9:32
  • @Caleb if I had to guess, I'll say "not in that location". Intriguing question, though. Dec 11, 2012 at 9:33
  • For info, the current behavior is linked to this bug, and links like [link text](http://x.y#http://a.b) - I'm trying to see if I can tweak the handling of ports in the outer url, though Dec 11, 2012 at 10:06
  • @Marc oh well, that bug teases me with waffles. Now I'm hungry. Dec 11, 2012 at 10:10
  • 1
    @MarcGravell: The relevant RFC makes it relevantly clear (as clear as RFC's generally are) that the colon is used as a component separator and that percent encoding should be applied to each component separately when you don't want the characters to be interpreted as possible component delimiters or other special functions. Applying the encoding to a multi-component bit and thus encoding the delimiter is pretty clearly wrong.
    – Caleb
    Dec 11, 2012 at 10:15
  • 1
    @Caleb heh; if you want uncertainty, ask each browser vendor whether the "+" in a "mailto" address needs escaping, i.e. mailto:[email protected]; there is no version that works on all browsers Dec 11, 2012 at 10:44

1 Answer 1

6

All fixed for future usage. Existing links may show using the old handling, and I don't propose refreshing them all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .