Stop Wordpress from turning double-dash into long dash
As an aside, Wordpress has this handy “feature” that automatically converts two dashes (’–’) into an emphasized dash (’–’, U+2013). While nicer typographically, this completely breaks code samples of any kind, as people will copy-paste it and get very confusing errors. I can’t believe the Wordpress coders wouldn’t get bit by this themselves. Alas, here’s how to fix it. Open up wordpress/wp-includes/formatting.php and find these lines near the top of the file, in wp_texturize
$static_replacements = array_merge(array(‘—’, ‘ — ‘, ‘–’, ‘xn--’, ‘…’, ‘“’, ‘’s’, ‘”’, ‘ ™’), $cockneyreplace);
Comment out the first four elements of both arrays, so that it looks like this:
$static_replacements = array_merge(array(/* ‘—’, ‘ — ‘, ‘–’, ‘xn--’, */ ‘…’, ‘“’, ‘’s’, ‘”’, ‘ ™’), $cockneyreplace);
This fix applies retroactively too, so you don’t have to go back and edit old entries, all of them will be updated automatically
I didn’t realise it was dumb enough to do that.
If you open a ticket on Trac, they might fix it. (Or, I might fix it if I get my head around the logic!)
Jeremy
1 Jun 07 at 5:57 pm
Thanks, this was making my flash imports crazy.
It’s weird though, SwfObject 2.1 uses “” for static embedding, and alot of people use SwfObject… this should definitely be a setting.
Ari
25 Mar 09 at 9:15 am