Single dash converted to double dash
Pergunta
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.
Solução
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('×', '–'); // <-- 8211 is an en dash
$replacements = array("x", "--"); // <-- here's where it's swapping in --
$the_content = str_replace($char_codes, $replacements, $the_content); // <--
Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange