Saturday, October 20, 2001
M & N's—the candy of the web
Stop! Go back and re-read the subhead above—at least 2–3 times—then let it sink in before continuing.
The sentence above illustrates the proper use of the hyphen and the two main types of dashes. They are not the same, and must not be confused with each other. In some fancy fonts the difference is more than just the width—hyphens have a distinct serif. If you don’t know the rules already, let’s review them. First, though, a definition:
An “em” is a unit of measurement defined as the point size of the font—12 point type uses a 12 point “em.” An “en” is one-half of an “em.”
Via Jeffrey Zeldman Presents: The Daily Report, A List Apart: The Trouble With EM 'n EN
So it made sense to use double hyphens (–) instead of em dashes and double primes (") instead of quotation marks. In any case, those workarounds were already familiar to anyone who’d grown up with typewriters, and readers adapted to ascii-only typography during the early days of the Internet when usenet, email, and the web all shared the same primitive markup and text display.
These days, standards-compliant browsers can handle entity names, and even Netscape 4.x can manage numeric entity codes—but why should you care? After all, using the technically correct punctuation marks would mean a dozen new entities to be memorized and a lineup of well-meaning but under-informed editors and teammates to win over—and retrofitting any significant amount of copy is always a hassle.
Also via Jeffrey Zeldman Presents: The Daily Report, A List Apart: Typography Matters
It may seem strange that a programmer would care about typography, but it's not unknown—Donald Knuth took 10 years off writing The Art of Computer Programming to write the computer typographic system, TeX.
So I wrote some code to translate some of the more egrarious hacks I've been using to get what I want, and converted over using the proper characters that are available. And yes, I checked the the Usual Suspects (Lynx, Netscape, Mozilla and Microsoft IE) and they all support the characters (well, Lynx as best as it can) required, so that's that.
Cleanup
In preparing to go live, I'm going through the past entries and making sure that they're consistent with what I'm doing now, and attempting to validate my documents to HTML 4.01 Strict.
So far it's taken me a few hours to go through December 1999, January
2000 and February 2000 and the
current entries. And in doing so,
I found out a couple of things I didn't know about specifying URLs within the
<A>
tag: You have to escape any ampersands in the
URL!
News to me, but I suppose if I read the spec carefully enough it would be apparent, and all the browsers I checked (Lynx, Netscape, Mozilla and Microsoft IE) all handled it correctly.
So it looks like that I might want to add code that accepts the entries to make corrections in the HTML code I type in. Maybe even include the code I wrote earlier so I can still type “ and not “.