I usually like to draft my WordPress posts in a raw text editor. When I need an em dash I’ll put two hyphens together, which is a common thing to do when the character itself is not readily available. (Em dashes can be put into raw text depending on the character encoding, but the keystrokes vary from system to system and editor to editor.)
WordPress, when publishing a post, will automatically convert two consecutive hyphens into a dash—but which dash, and when? An em dash will result if the two hyphens are surrounded by spaces. When those spaces are omitted, an en dash is displayed instead. So make sure to double check your post when in preview mode if you want an em dash, especially if you don’t want it spaced.
I’ve taken to using HTML entities to get my em dashes, simply because I find it more straightforward and consistent. This can be done by switching to the HTML tab on the Edit Post screen and replacing the dash (or hyphens, or whatever character you might be using) with the string —.
Here are some examples.
- “word ‐‐ press” will result in word — press (open em dash).
- “word—press” will result in word—press (closed em dash, through the HTML tab).
- “word‐‐press” will result in word–press (closed en dash).
Update (June 2, 2011):
A triple hyphen in either Visual or HTML editing mode will result in an em dash. This is principally what I use now because it’s quick and easy.
Typing ‐‐‐ will give you the following: A sentence—an example sentence.