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

Possible Duplicate:
Auto “possible duplicate” comment should use trimmed title?

When I voted to close a question as an exact duplicate, the following comment was auto-inserted:

possible duplicate of [ Sending Email in Android using JavaMail API without using the default Android app(Builtin Email application)](http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-a)

possible duplicate of Sending Email in Android using JavaMail API without using the default Android app(Builtin Email application)

Note the space leading into the link caption. It doesn't break in this question description, but it breaks in comments. I checked the original question, and it didn't appear to have a leading space in the title. I would have expected the inserted comment to be:

possible duplicate of [Sending Email in Android using JavaMail API without using the default Android app(Builtin Email application)](http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-a)

possible duplicate of Sending Email in Android using JavaMail API without using the default Android app(Builtin Email application)

share|improve this question

marked as duplicate by balpha Oct 10 '12 at 13:36

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.

    
Hmm, the actual problem is that the title shouldn't be allowed have that space to begin with... –  Tim Stone May 1 '12 at 20:30
    
You mean this problem has already been resolved and Jeff's unit tests didn't notice when it broke again? TISK –  Alain May 1 '12 at 20:37
    
@TimStone: The leading whitespace is unnecessary and should be trimmed, but as far as I know, the Markdown specification allows links to begin with a space. I still think is is a bug in the Markdown parser. Trimming the whitespace is just a patch. –  Dennis May 1 '12 at 20:50
    
So two bugs then: 1. The Markdown parser should allow leading and trailing spaces in the link alt text, and 2. Question titles should be trimmed on save if they contain leading/trailing spaces. –  Alain May 1 '12 at 20:55
    
@Dennis The behaviour is bydesign in the Markdown mini formatter used for comments. –  Tim Stone May 1 '12 at 20:57
    
@TimStone: I don't get what's the advantage of that, but Jeff said so, 'nough said. –  Dennis May 1 '12 at 21:00
    
@Dennis It was apparently part of Jeff's scorched earth solution to people circumventing the minimum character limit in comments, where one of the methods used was padding out dummy links with spaces. –  Tim Stone May 1 '12 at 21:04
1  
​​​​​​​​​​​​​​​ –  Dennis May 1 '12 at 21:05
    
@TimStone: Not a very successful one... –  Dennis May 1 '12 at 21:05

1 Answer 1

No, this is not a bug in the auto-insert, but a bug in the Markdown parser for comments.

The title of Sending Email in Android using JavaMail API without using the default Android app(Builtin Email application) actually has a leading space in its name, so the auto-insert didn't do anything wrong.

The Markdown parser, however, automatically converts the

http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-a

part of

[ Sending Email in Android using JavaMail API without using the default Android app(Builtin Email application)](http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-a)

into a link, breaking the syntax in the process.

share|improve this answer
    
Aah yes, it's trimmed out in the Header, but if I click "edit", I can see the space. –  Alain May 1 '12 at 20:25
    
Shouldn't the spaces be trimmed for constancy? –  Justin May 1 '12 at 20:27
    
@Justin: Not seeing the space in the formatted question is normal, since HTML ignores whitespace at the begging of a tags inner HTML. I can't think of a single reason why a question should commence with a space though... –  Dennis May 1 '12 at 20:30
    
Me either, I would expect bad user data sent to the server and the code just didn't kill the white space in the beginning. –  Justin May 1 '12 at 20:31
    
This is not correct. Link texts in comments are not allowed to start with a space, which is very intentional (since the only thing it's useful for is working around the 15-char limit), so it's the auto-insertion that has to compensate for this. –  balpha May 2 '12 at 4:37
    
@balpha: I see. Couldn't you just not count whitespaces (9, 20, A0, 200A, 200B)? That wouldn't break markdown syntax and prevent many, many other ways around the 15 character limit... –  Dennis May 2 '12 at 14:05

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