11

Here's the screenshot of my experience with italic text over Stack Overflow.

screenshot

Basically it just wraps the word into asterisks and leaves it like this. Here on Meta I do not observe this bug.

  • It's because underscore _ also delimits italic. _italic_ -> italic – ChrisF Jan 21 '12 at 13:51
  • As a workaround for @Chris' comment: use *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
  • 1
    *unique\_names* -> unique_names (just to prove it works) – ChrisF Jan 21 '12 at 13:58
  • For me, it's the same on Meta. – Arjan Jan 21 '12 at 13:59
  • Are you sure about your "Here on Meta I do not observe this bug"? – Arjan Jan 22 '12 at 15:43
15

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

  • 1
    Still, I wonder if this is expected. On SE sites, emphasis within a word (intra-word emphasis) is explicitly disabled, to avoid emphasis of dear in 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
  • The current behavior is certainly not what I would expect. For starters, *_* results in an italic underscore. – Dennis Jan 21 '12 at 14:11
  • Hehe, I hope you had to peek into the HTML source to tell that the underscore is (told to be) rendered italic for *_*? Spot the difference: _ versus _ ;-) – Arjan Jan 21 '12 at 14:14
  • So you can't tell the difference? – Dennis Jan 21 '12 at 14:25
  • 3
    I even zoomed in, but: no. :-) – Arjan Jan 21 '12 at 16:37
2

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.

1

This is fixed in the next build.

You must log in to answer this question.

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