1

If I write

*pre*relational

then it comes out as

prerelational

with italics for the pre part.

If I write

*pre-* relational

then I get

pre- relational

with correct italics but a space.

I would expect

*pre-*relational

to generate italics for the pre- part; but actually what I get is

*pre-*relational

I can get what I'm looking for by typesetting it as

*pre*-relational

which comes out as

pre-relational

because it doesn't make any difference whether the hyphen is in italics or not, but it still looks to me as though there's a bug lurking in the parsing of the *pre-*relational case.

0

2 Answers 2

3

Escape the - by replacing it with \-:

Without: *pre-*relational

With: pre-relational

1
  • Ah, cool! Didn't know backslash operated as an escape in this context! Oct 7, 2014 at 5:23
3

It's because the "-" is inside the italic marks - as you have discovered in your testing.

From balpha's announcement here:

Markdown change: Intra-word emphasis now works

The following point is relevant:

  1. If a single or double asterisk is supposed to be interpreted as intra-word emphasis, it cannot have punctuation on one side; it actually must be inside a word. An example of an edge case this solves is

    It's a web*-based solution.

    *see Wikipedia for a definition of "web"

where the asterisks after "web" could cause unintended italicizing if there was a second asterisk in the same paragraph somewhere.

2
  • Hmm, does this mean that *pre*-relational shouldn't work either? (It has punctuation on one side of the second asterisk.) Oct 6, 2014 at 10:03
  • @chiastic-security - Ah - it looks like the point I copied is only tangentially related to the problem. However, I would suspect that the "inside word" rule applies here too.
    – ChrisF Mod
    Oct 6, 2014 at 10:05

You must log in to answer this question.

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