Fixing -- in WordPress

One thing that I've noticed is that whenever I used -- in a post, such as this one, WordPress converted the -- to &emdash; which whilst very pretty doesn't work so well for people trying to understand command line switches to ./configure!

Today, I finally got around to poking into the WP source code to work out what was happening and I tracked it down to the wptexturize function in the wp-includes/functions-formatting.php file. Once I knew the name, it was trivial to google for a solution and I found Jason Litka's Disable wptexturize plugin. I couldn't find it through WordPress' new built-in plugin installer, so I installed it the old-fashioned way and now the code in my posts will make more sense!

2 Responses to “Fixing -- in WordPress”

  1. 1 Joseph Scott

    Another solution would be to use a plugin to format source code sections of posts. I use the SyntaxHighlighter plugin for this:

    http://wordpress.org/extend/plugins/syntaxhighlighter

    There are plenty of other options out there as well.

  2. 2 Cliff Stanford

    > now the code in my posts will make more sense!

    Promise? :)

The views expressed in these comments are not the views of the publisher. However, we believe in the rights of others to express their legitimate views and concerns. Any legitimate complaint emailed to rob@akrabat.com will be seriously considered and the post reviewed as desirable and necessary.

Leave a Reply

Buy now!