notdavidhayes
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Removing “emdash” replacementI was sad to see that no one gave what was to me a satisfactory answer, so I’ve created it.
For WP 2.2 (I don’t know about other versions), Find these lines in /wp-includes/formatting.php (they’re near the top):
$static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '
', '\'s', '\'\'', ' (tm)'), $cockney);
$static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace);
[Sadly this page is displaying the em and en dashes, etc, rather than the code, so that’s not what the PHP file will look like. I apologize, but I don’t know how to fix it. Look for the first line, the second line will be immediately after it, though it’ll look different than this.]
Because you’re looking to change the replacement of ‘–‘ to the EM dash (#8212) from the EN dash (#8211), simply change the third value in the second (_replacements) array. Make it say, #8212, not #8211. In other words, the lines should look like [but not really] this when you’re done:
$static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '
', '\'s', '\'\'', ' (tm)'), $cockney);
$static_replacements = array_merge(array('—', ' — ', '—', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace);
I will also note that I know that both moshu’s ( — ) and satchel’s (—) solutions work–they create the desired EM dash (though moshu’s obviously has spaces around it). I realize that blaze went a different way, but now when someone finds this page through Google (as I did) they’ll have the answer they’re seeking.