Technocrank

Icon

It Done Broke.

wp-Typography Beta for WordPress

Haven’t gotten around to installing it yet, but last week wp-Typography (a merge between wp-Hyphenate and wp-Typogrify) for WordPress was released under a beta version.  The author has also factored out the functional code into a separate PHP package for typography.

Typogrify WordPress Character Replacement

Typogrify 1.6

Something’s a little loose in Typogrify’s pattern matching code.  There’s an option for it to

Add <span class="amp"> to ampersands.

…which does just that, but it doesn’t check the context of the ampersand’s placement.  It will grab an ampersand in the middle of an anchor tag, for instance say, in a title attribute and nuke it.  The results are this:

<a title="Bob <span class="amp">&amp;</span> Doug McKenzie" href="http://www.hoser.com">Take off, eh?</a>

…which leaves a broken link and HTML guts all over the page.  Like, you really don’t need that many double quotes in there, do you now.  The regex code in Typogrify works if instead of “amp” it used ‘amp’ with single quotes (unless your attribute is enclosed with single quotes).  At least it doesn’t break the HTML into tiny little pieces.  However, there’s a larger question as to whether or not you really need a span inside an title attribute – or even anywhere inside HTML code.  It’s more code to do a check that you’re not pattern matching inside HTML tags, but it’s been done.  Maybe this will be addressed in wp-Hyphenate when it gets rolled in.

WP-Typogrify WordPress Plugin: Widows

Typogrify 1.6
Wordpress 2.7.1

The Typogrify plugin seems to wipe out the content of some single post pages when the widow prevention option is activated.  I don’t have the patience right now to troubleshoot it, but the wp-Hyphenate plugin mentioned on the Typogrify home page also handles widows and also deals with quite a few other typography concerns.  It seems Typogrify and wp-Hypenate will be merged at some point.

Note: if you decide to install wp-Hyphenate, don’t download it from the website and then try to directly install it from the Zip file using WordPress’ plugin installer (i.e. “Add New” in 2.7).  The Zip file is a wrapper which encloses the actual plugin code in a superfluous directory and causes WordPress to be unable to find the plugin.  If you accidentally do this, you’ll have to log into your WordPress install, go to wp-content/plugins/wp-Hyphenate_1_07_beta (or whatever the current wrapper version is) and move the enclosed wp-Hyphenate directory a level up into wp-content/plugins. Also, this plugin doesn’t seem to be available yet on the WordPress plugin directory.