Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

As the title says, if a single dash is used with a space between each side eg. 'Die Hard - Action Film' is written in to a WordPress post, once published it comes out as 'Die Hard -- Action Film'. If no spaces are used around the dash it works, but obviously this isn't desired.

I've obviously found out it's not something that happens with a default install of Wordpress but I can't seem to pinpoint what the cause is in my theme.

share|improve this question
    
You will have to post what theme you are using, the plugins you are using and possibly your functions.php contents to be able to get the help you need. –  Lyken May 18 '11 at 23:29
    
there's probably something filtering the_content and doing some sort of swap. as Lyken said- start in your theme's functions.php file, look for any add_filter('the_content','some_func') calls. –  Milo May 18 '11 at 23:35
    
Lyken, thank you so much. I decided to turn off a few plugins and found out the 'Smart YouTube' plugin was the culprit. Now I have to figure out if I can fix it or just drop the plugin all together. –  dwhip May 18 '11 at 23:39
add comment

1 Answer

up vote 0 down vote accepted

It's lines 396 - 398 in the smart youtube plugin's smartyoutube.class.php file:

function check($the_content, $side = 0)
{
    if (strpos($the_content, "httpv") !== false  ) 
    {
      $char_codes = array('&#215;', '&#8211;'); // <-- 8211 is an en dash
      $replacements = array("x", "--"); // <-- here's where it's swapping in --
      $the_content = str_replace($char_codes, $replacements, $the_content); // <--
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.