What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

This question already has an answer here:

While reviewing http://stackoverflow.com/q/3139601/212218#3139749 I noticed that the URL that was posted as one of the answers looked weird to me:

leopard_9m2809a.dmg">http://adcdownload.apple.com/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.1.4_leopard_9m2809a.dmg

I clicked on the edit link to see if the user had perhaps posted some broken HTML, but all I found was a bare URL:

http://adcdownload.apple.com/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.1.4__leopard__9m2809a.dmg


Here's how the above URL renders currently:

leopard_9m2809a.dmg">http://adcdownload.apple.com/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.1.4_leopard_9m2809a.dmg

(I'm assuming) it should look like this:

http://adcdownload.apple.com/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.1.4_leopard_9m2809a.dmg


EDIT: I wonder if it has anything to do with the double underscore that is causing the word "leopard" to appear italicized?

Let's try that out by removing the double underscore:

http://adcdownload.apple.com/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.1.4_leopard_9m2809a.dmg

Aha! That must be it.

share|improve this question

marked as duplicate by balpha Apr 11 at 9:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
This also blew up a YouTube video I tried to put on a page. –  CyberSkull Jan 3 '12 at 20:15

1 Answer 1

up vote 4 down vote accepted

It looks like the auto-linker passes in the URL as-is, the result of which is then fed to the method that handles bold/italics. This causes an <em> tag to appear in the href attribute of the link, the HTML sanitizer gets angry, and you end up with the mess that you see there.

The most direct fix seems to be to have the auto-linker do what the normal linker does and have the replace method do ml = escapeCharacters(ml, "*_") when inserting the URL in the preview, and the equivalent link = EscapeBoldItalic(link) in MarkdownSharp. I need to verify that this doesn't break anything else, but if it doesn't I'll submit patches later provided this isn't fixed before then.

I should add that with links that ugly it's much nicer if they have a proper descriptive text anyway, but the behaviour does seem buggy in either case.

Update: It seems that this was already because Jeff felt it was too much of an edge case, but I've gone ahead and made a fix for Pagedown anyway.

share|improve this answer
    
Does your fix get used in SO? The link to the commit in your answer is currently 404. –  nhahtdh Feb 20 '13 at 5:07
    
Oh, whoops. But no, it's not used on SO. –  Tim Stone Feb 20 '13 at 13:18