8

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)](https://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)](https://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)

9
  • Hmm, the actual problem is that the title shouldn't be allowed have that space to begin with...
    – Tim Stone
    Commented May 1, 2012 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
    Commented May 1, 2012 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
    Commented May 1, 2012 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
    Commented May 1, 2012 at 20:55
  • @Dennis The behaviour is bydesign in the Markdown mini formatter used for comments.
    – Tim Stone
    Commented May 1, 2012 at 20:57
  • @TimStone: I don't get what's the advantage of that, but Jeff said so, 'nough said.
    – Dennis
    Commented May 1, 2012 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
    Commented May 1, 2012 at 21:04
  • 1
    ​​​​​​​​​​​​​​​
    – Dennis
    Commented May 1, 2012 at 21:05
  • @TimStone: Not a very successful one...
    – Dennis
    Commented May 1, 2012 at 21:05

1 Answer 1

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

https://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)](https://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.

6
  • Aah yes, it's trimmed out in the Header, but if I click "edit", I can see the space.
    – Alain
    Commented May 1, 2012 at 20:25
  • Shouldn't the spaces be trimmed for constancy? Commented May 1, 2012 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
    Commented May 1, 2012 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. Commented May 1, 2012 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 StaffMod
    Commented May 2, 2012 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
    Commented May 2, 2012 at 14:05

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