6

Didn't see this reported yet, so here it goes:

EDIT: Short version

Some markdown is allowed in post comments, but it doesn't behave the same way as in questions/answers (doesn't even share the same bugs!). Imo, this comments-markdown should behave equally, esp. because most of us cannot edit comments.


Full version

If you write the following markup in a comment:

About *this*: tell me, what's this?
 Or: About _this_: tell me, what's this?
 Or: About *this*: tell me, what's *this*?
 Or: About *This*IsIt!

it will not render correctly, but looks like this:

About *this*: tell me, what's this?
Or: About this_: tell me, what's this?
Or: About this*: tell me, what's *this?
Or: About *This*IsIt!

while this is expected (and works on questions and answers):

About this: tell me, what's this?
Or: About this: tell me, what's this?
Or: About this: tell me, what's this?
Or: About ThisIsIt!

If you end with a comma, dot, exclamation mark, question mark or space, it will render correctly. It goes wrong with colon, semi-colon, any alphabetic character. I haven't tried other combinations yet. Same goes wrong for bold.

I came across it in the second comment to this answer, fixed it with a space. I have this quite often and find myself deleting and resubmitting. Can this be fixed the same way it works with normal posts?

8
  • 1
    Not always tagged as you expect: meta.stackexchange.com/questions/21680/… Nov 7, 2009 at 18:18
  • 1
    I know that one, that's about questions. This is about discrepancies between comments and questions. I know that comments have a limited syntax, but the syntax that is allowed should at least work the same as in questions, hence reported and marked as a bug. Can you reopen?
    – Abel
    Nov 8, 2009 at 11:36
  • And: this is not about intra-word markdown (which doesn't work in comments either as shown above), but about simple full word/part sentence italics/bold markdown. All these things are "what you see is what you get". But in comments, you don't see, you just get, and you get something different.
    – Abel
    Nov 8, 2009 at 11:38
  • 1
    This is intra-word markdown. What makes you think, that colon, semi-colon and an alphabetic character behave different form the intra-word problem? Nov 8, 2009 at 20:56
  • Ok, point taken, but intraword (i.e., alphanum) has always given me problems in a variety of situations, intrapunct (if I may call it that) has never (don't hold your breath) given me problems, at least not in questions/answers. Hence I consider them "different", just as \p{L} (letters) is different from \p{P} (punctuation) in regular expressions. Frankly, I don't see why you are not considering them differently :)
    – Abel
    Nov 9, 2009 at 7:53
  • How about this: thar then? (Transpose that semi-colon)
    – random
    Nov 9, 2009 at 8:14
  • 1
    @random: that's an obvious way to workaround it. Any program has bugs, many bugs have workarounds, but that doesn't change the fact that the behavior is wrong. You can also decide to consider it a bug but not consider it needs fixing (why would you). You can also add to the FAQ: italics/bold allowed in comments, but only when ended with some punctuation, but we don't know exactly which. Then at least we know that we can expect surprising behavior.
    – Abel
    Nov 9, 2009 at 12:17
  • 1
    @Abel: No-one reads the FAQ. So why bother updating it? Nov 9, 2009 at 21:03

3 Answers 3

1

This is very annoying, as I'm used to it working one way in the post editor and often fail to remember the extra spacing needed for comment formatting. Here's a comment just posted this morning - tremble at the ugliness!

@Ruddy: I don't think so... pBlock is of type TCHAR**, so an index applied to (*bBlock) will be an index into an array of `TCHAR`s. Note that if it was actually a byte array, you'd need to cast it to a TCHAR array first anyway in order to set a double-byte NULL terminator! @unknown: I missed this last night, but... You're `free()`ing the wrong object! See my edit...

2
  • Well put: very annoying indeed. Just make the two systems equal (comment and post editor) and simply deny certain features in the comment (blocks, newlines) to keep it intuitive.
    – Abel
    Jan 29, 2010 at 12:26
  • Accepted this as answer as it best signifies the annoyances put forth by the dissimilar systems.
    – Abel
    Jul 28, 2010 at 13:01
1

I just ran into a similar problem trying to comment on this question.

I wanted to make a word bold inside quotes:

"possible duplicates"

but that got rendered like this:

"**possible** duplicates"

I was going to report it, but found this. I think it's the same problem.

I ended up adding a space between the quote and the word:

" possible duplicates "

1
  • It is indeed similar. Comments apparently use a version of Markdown that's not as strong and well-tested as the original Markdown and the answers from the dev team so far range from "not a bug" to "by design", which is not very helpful. Hopefully someday someone gets up and fixes these annoying bugs.
    – Abel
    Jan 16, 2010 at 17:48
1

We can add the colon/semi-colon if you want, I guess, but I don't really see the point.

There are a combinatorial explosion of side effects the more characters we allow to trigger this.

edit: I added semi-colon and colon to the allowed terminators per your request.

5
  • 1
    Y'know, if you didn't have formatting in comments, problems like this wouldn't happen.
    – random
    Nov 9, 2009 at 5:13
  • If it is so hard (which I seriously doubt, but I haven't seen your implementation, but why not use regex predefined Unicode classes? They fit the need to a large extend), why then are the behaviors so different in comments, compared to questions/answers? But I assume, you use a whitelist approach (safety first), not a blacklist approach, which means you have to redo the whole parsing, which necessarily introduces new bugs while stripping everything non-whitelisted.
    – Abel
    Nov 9, 2009 at 8:00
  • 4
    At the very least, allow it to work with a zero width space. Nov 10, 2009 at 22:40
  • 1
    PS: I'd like to see this combinatorial explosion of side effects, when the same side effects don't seem to hamper proper implementation in questions and answers...
    – Abel
    Nov 12, 2009 at 11:35
  • any chance you'll reconsider bold+italic while you're in there messing with the code?
    – Kip
    Aug 9, 2010 at 13:27

You must log in to answer this question.

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