WordPress Changes Double Dashes to Single Dashes: Make It Stop
WordPress does about 90% of things well and in sane, sane fashion. The other 10% will make you want to gnaw a limb off a cute little kitten.
After putting up with the whole "–" becoming "-" for as long as I could, I finally snapped and tried to look around for a solution. I had fixed this at one point, in a previous version of WordPress, but for some reason they moved stuff around and the first time I tried to find it I couldn't.
I tried to find something that would take care of it for me, or at least the good word on how to make it go away, but the hits I found on Google weren't very helpful. There's nothing worse than "helpful assholes" who try to tell you that you should just get used to something and why would you ever want to do it That Way to begin with? It seems like every time somebody wants to change something formatting-wise in WordPress, some of these HAs show up and want to waste your time with trying to convince you instead of just telling you what the hell you need.
So here's what I needed, in case anybody else needs it:
1. Go to wp-includes.
2. Find the formatting.php file
This is, of course, for WordPress 2+, I believe. If you try to find this and something doesn't fit or something isn't where I say it is, you're probably in a different version. I'm on 2.1.3 right now.
3. Find these two lines:
$static_characters = array_merge(array('—', ' — ', '–', 'xn--', '…', '"', '\'s', '\'\", ' ™'), $cockney);
$static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '"', ''s', '"', ' ™'), $cockneyreplace);
4. Comment them out by placing a // in front of them.
5. Done.
Now, granted, that probably knocks out a lot of other formatting as well, but I'm a lazy bastard and it didn't seem to adversely affect anything I was doing. And if I tried to take out just bits of it, it did funky things. So. There you have it. YMMV.
2 Comments »
RSS feed for comments on this post. TrackBack URL

It's possible that if you remove the
' — ', '–',
bit from line 1, and the
' — ', '–',
from line 2, you might be able to keep the other rules, but you've probably already tried that.
Jones: Thanks for the comment. Yeah, I tried pulling out just the bits that looked right but for some reason that set off other changes. No idea why.