Here's the screenshot of my experience with italic text over Stack Overflow.
Basically it just wraps the word into asterisks and leaves it like this. Here on Meta I do not observe this bug.
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.
Sign up to join this communityHere's the screenshot of my experience with italic text over Stack Overflow.
Basically it just wraps the word into asterisks and leaves it like this. Here on Meta I do not observe this bug.
As ChrisF said, the problem is the underscore. _
is a control character, and control characters might behave differently from what you expect.
Just escape the underscore (\_
) and it will work:
*unique\_names*
results in
unique_names
hello_dear_world
. That said, maybe the expected behavior is that asterisks and underscores in words are totally ignored, and escaping would not be needed?
– Arjan
Jan 21 '12 at 14:04
*_*
results in an italic underscore.
– Dennis
Jan 21 '12 at 14:11
*_*
? Spot the difference: _ versus _ ;-)
– Arjan
Jan 21 '12 at 14:14
Is this a discrepancy between the JavaScript preview and the rendered post? Let's see:
unique_names
No, so they are at least consistent.
I agree it's not exactly what I would expect to happen.
uniquenames*
provides a similar but .. more logical .. result as we disable intra-word emphasis, so perhaps the regex just treats *_
as part of the same character group.
_
also delimits italic._italic_
-> italic – ChrisF♦ Jan 21 '12 at 13:51*unique\_names*
or_unique\_names_
instead. (So: escape using a backslash.) I wonder if this is expected behavior though! – Arjan Jan 21 '12 at 13:57*unique\_names*
-> unique_names (just to prove it works) – ChrisF♦ Jan 21 '12 at 13:58