So, this is the URL:


When I insert the URL like so:


the last part of the URL changes from




What's going on here?

Note: See my comment below for a live demonstration of the issue! Feel free to copy the URL and try it for yourself... (It seems that the URL is only altered if the []() notation appears within a comment, but not when it appears within a question/answer.)

  • Proof Feb 16 '12 at 20:50
  • Confirmed. Also, it changes ECMAScript,_Part_2 to ECMAScript,iPart_2.
    – Dennis
    Feb 16 '12 at 21:13
  • 6
    Markdown parser bug - one underscore after the comma and one before the dash are turned into <i> tags, which are then sanitized. (educated guess)
    – a cat
    Feb 16 '12 at 21:15
  • It'd be saner to use a URL shortener. Mar 21 '12 at 5:29
  • 2
    +1, this is still happening, although apparently now the angle brackets are no longer getting stripped. Feb 5 '14 at 12:00

There were actually two changes:

                          ^                          ^^

The Markdown Mini parser applies its italics check before performing link conversion, and the comma is one of the characters that's allowed before an underscore (or asterisk) when looking for the italics pattern. This caused the "Part_2:_Harmony_Highlights/" part of your URL to be surrounded by an <i> tag pair, and the relevant underscores to be removed.

Since in the case of comments URL santitation is done by removing characters not on the whitelist, the angled brackets caused by the previous step were dropped and you were left you with just the is.

The immediate solution to this is to simply escape the problematic first underscore, which will prevent the accidental italicising:

  • I see. I won't be using commas or dashes in my URL fragments then... (at least in scenarios where I have underscores as word-delimiters) Feb 16 '12 at 21:41
  • @ŠimeVidas Whoops, I wasn't thinking fully yesterday though, there's a much saner way to work around this, per my edit.
    – Tim Stone
    Feb 17 '12 at 19:49
  • Example comment: escaped url
    – Tim Stone
    Feb 17 '12 at 19:49
  • OK, cool :) What's up with the / after Highlights though? Feb 17 '12 at 20:36
  • Ah, mistakenly copied it from the broken URL, where it was part of the closing </i>.
    – Tim Stone
    Feb 17 '12 at 20:37

As you can see in your comment, this is fixed now. Tim's answer was absolutely correct; I finally fixed this when enabling intra-word emphasis in comments, because that would have made this problem even worse.

You must log in to answer this question.

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