April 19, 2002
A small step for web typography
A Textpad macro that converts quotation marks and dashes with one keypress. Towards a foolproof route from Word to HTML.
By far the most common special characters, in my experience, that need to be converted for use on the Web are
- apostrophes ’
- “double quotation marks”
- ‘single quotation marks (which includes the apostrophe)’
- en-dashes –
- em-dashes —
But almost no web sites bother. With just these 4 characters correctly displayed, typography on the web would already be vastly improved.
Stuck with MS Word
For all it’s faults, Word is still the only editor I know of that makes it easy for anyone to actually use these special characters correctly without having to memorise cryptic keyboard shortcuts. Apostrophes, single and double quotes, and en-dashes are automatically inserted during normal typing. The em-dash can be inserted with the shortcut key Ctrl+Alt+Num- (that’s the minus on the numeric keypad.) Word also happens to be the most popular (as in commonly-used) word processor. Nearly all 3rd-party content I receive for web publishing originate in Word. So it’s pretty much impossible to remove it from the equation.
Reaching for low-hanging fruit
At its simplest (forgetting for now HTML tags), my wish was to be able to Copy from Word and Paste into a plaintext editor (either an HTML editor or a web form) with the above 4 characters converted in such a way that all browsers display it correctly. Sounds simple, doesn’t it? Well, no plain text editor I know does this automatically. And Dreamweaver’s design view doesn’t do it right either. So a conversion step is necessary. This is anyway unavoidable if the text is destined for a web form, e.g. in a CMS.
So here’s what you do:
- Download this macro,
- install it in Textpad,
- assign it the keyboard shortcut (say) F10,
- Copy your text in Word,
- Paste it into Textpad,
- press F10,
- and then it’s ready to be copied and pasted into your HTML code.
- Repeat steps 4-7.
I know this will make a great difference to me. I don’t know whether others will agree. Please let me know what other conversions you’d like me to include in the next version of this macro. Likewise, if you find bugs, if you have a better method, or know why this is a waste of time, please let me know.
Post a comment
(HTML is OK. Two linebreaks are converted to a <p>, one linebreak to a <br />. Represent all occurrences of <, >, and & by character or entity references, i.e. <, >, and &.)