Smarty Pants: More Unicode Characters

John Gruber gruber at fedora.net
Mon Nov 7 16:23:07 EST 2005


Christoph Freitag <mail at christoph-freitag.de> wrote on 11/5/05 at 9:46 PM:


> even if this is not new at all I would nevertheless like to put forward

> my list of unicode character substitutions that I would like to see

> implemented in a future version of Smarty Pants:

>

> you type | output | Unicode

> -----------|----------------|---------

> (c), (C) | © | 00A9

> (P), (p) | ℗ | 2117

> (tm) | ™ | 2122

> (R), (r) | ® | 00AE


These are somewhat reasonable, and several other people have
requested support for them previously. I'm a little loathe to add
support for them to SmartyPants, however, because at least on a Mac,
it's rather easy to type them manually:

Option-G: ©
Option-R: ®
Option-2: ™

Although I'll admit I don't know, offhand, the shortcut for ℗.



> (+) | ⊕ | 2295

> (/) | ∅ | 2300

> (x) | ⊗ | 2297

> (.) | ⊙ | 2299


These strike me as pretty obscure.




> :), :-) | ☺ | 263a

> :(, :-( | ☹ | 2639


SmartyPants will never support smileys. Someone else should create
SmileyPants if they want auto-smileys.



> -> | (configurable) | 2192 (e.g.)


My private build of SmartyPants 1.6 supports the following
transformations:

-> &rarr;
<- &larr;



> => | (configurable) | 2102 (e.g.)

> <=> | ⇔ | 2104

> >= | ≥ | 2265

> <= | ≤ | 2264


Maybe, especially for `>=` and `<=`.



> /= | ≠ | 2260


I'm not sure about this.



> 1/2 | ½ | 00BD

> 1/3 | ⅓ | 2153

> 2/3 | ⅔ | 2154

> 1/4 | ¼ | 00BC

> 3/4 | ¾ | 00BE


I don't like the idea of supporting Unicode fractions, because then you're limited to the specific fractions with their own glyphs. If

1/4

works, then why shouldn't the user expect

5/33

to work as well?



> It would be best if the user could specifiy these substitutions in a

> definition table at the top of the script (or maybe in an external

> file). This is also because I am not so sure about enclosed numerals,

> like (1) -> ➀. If the user could define that when needed ... fine!


Some sort of configuration table would be nice for advanced users --
those who want to use SmartyPants more as an API. But there need to
be a very reasonable and usable set of defaults.

-J.G.


More information about the Markdown-Discuss mailing list