Friday, October 20, 2006

[HTML] em dash character

I'm having a problem with em dashes. I'm fond of asides set off by this piece of punctuation, but HTML doesn't seem to share my passion. As far as I know, there's no semantic em dash token (along the lines of amp, eacute, and so forth). I've been using the numeric code that often maps to an em dash (151), but that has always been subject to the whim of the encoding scheme in the browser, and lately that's broken for a number of my readers. In particular, Bloglines now renders my em dashes as ? or little boxes with a's in them, or whatever.

So what do other folks do for em dashes? It seems silly to write modern text as if I were still using a typewriter, with -- serving the purpose, but I may have to resort to that if I can't figure out a consistent way to get the appropriate punctuation to show up in browsers et al.

Any ideas?

[Update: I wrote this and then went searching for the answer elsewhere. A good article can be found at http://alistapart.com/articles/emen/. But I thought I'd do the post anyway so that anyone who had the same question could still learn from it.]

This Post was written by Derrick from An Obsession with Food.

10 comments:

Anonymous said...

Have you tried —? It seems to work.

Anonymous said...

Make that "‐".

Anonymous said...

Arggg..... "&mdash"!

cookiecrumb said...

Derrick: Here's an HTML keyboard I use for funny characters:
http://www.foxinternet.co.uk/keyboard.html

Just click on the symbol you want to use and you'll get the code for it. Paste the code right into your text and it publishes as the symbol you want. Wow. Extra steps, yes, but it works.

Catherine said...

& 8212 without the space

Primavera said...

dear derrick,

have you tried using this html code:



i found it here (way down on the page):

http://www.ascii.cl/htmlcodes.htm

Primavera said...

derrick,

that seemed to work a little too well! no matter how i try to disguise it, it comes out as the em dash! just scroll way down on the page, ok?

or try this--just remove the spaces!

& # 8212 ;

Derrick said...

Hey, everyone, thanks. Indeed — seems to be the key if you want to use the semantic token (as opposed to —, the decimal representation). There's also – for those who really want to be pedantic.

Anonymous said...

Buy lv online to save money. If you decide to buy a replica louis vuitton handbags for yourself or someone important you can start by shopping online for lv handbag
. You will find that Louis offers a large selection of handbags to choose from. There are several online stores that offer discounts on these handbags. One in particular store being eBay that offers a vast selection of louis vuitton bag
for much lower prices.

hou said...

here are several online stores that offer discounts on these handbags.
meizu m2 note
xiaomi mi5
meizu pro 5