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.

Compare and contrast how the site renders the following three links:

  1. http://wiki.teamfortress.com/wiki/Civilian_(Classic)
  2. http://wiki.teamfortress.com/wiki/Civilian_(Classic)
  3. http://wiki.teamfortress.com/wiki/Civilian_%28Classic%29

Source:

1. http://wiki.teamfortress.com/wiki/Civilian_(Classic)
2. http://wiki.teamfortress.com/wiki/Civilian_(Classic\)
3. http://wiki.teamfortress.com/wiki/Civilian_%28Classic%29

The site behaves correctly. Chat... not quite as much. This is how chat renders each of these links:

  1. http://wiki.teamfortress.com/wiki…)
  2. http://wiki.teamfortress.com/wiki…;
  3. http://wiki.teamfortress.com/wiki…

You can see the Stack Exchange RandomSneaky ComplimentarySemicolon* pop up out of nowhere in line 2. You can see this in action here.

What's up with the Stack Exchange RandomSneaky ComplimentarySemicolon*?

*I'm sorry. So, so sorry.

share|improve this question
6  
You're not sorry at all! –  Tim Stone Jan 5 '13 at 23:08
    
This should also likely happen in comments: wiki.teamfortress.com/wiki/Civilian_(Classic); –  Tim Stone Jan 5 '13 at 23:14
    
Related: strange character replacement on SO. –  Arjan Jan 6 '13 at 15:00

1 Answer 1

The MarkdownMini implementation used in comments and chat uses a quick and simple approach to avoiding escaped characters – it simply converts them to HTML entities, so when you slash escape the parenthesis at the end, you're actually getting

text = text.Replace(@"\)", ")");

The autolinker regex doesn't allow for the trailing character to be a semicolon, so it lops it off when taking your URL and you get a link with a href value of

http://wiki.teamfortress.com/wiki/Civilian_(Classic&#41

where the browser ever so helpfully decides that the malformed entity is the closing parenthesis your heart desired.

Not necessarily the most desired behaviour, but short of making the escape process a bit more complicated for this specific case, I'm not sure there's much to be done about it.

share|improve this answer
2  
You've likely confused me for Tim Post –  Tim Stone Jan 6 '13 at 15:05
    
ahh.. Sorry about that. –  AsheeshR Jan 6 '13 at 15:05
    
It happens quite often, don't worry ;) –  Tim Stone Jan 6 '13 at 15:06
    
Hmm.. this whole thing wouldn't be a problem if the autolinker were smart enough to swallow trailing close parentheses when there's a corresponding unclosed open parenthesis in the link. Of course, if it's really implemented as just a single regex, that could get a bit tricky. (Not impossible, at least not with modern PCRE variants, but tricky.) –  Ilmari Karonen Jan 7 '13 at 2:12

You must log in to answer this question.

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