diff --git a/fp-includes/core/core.wp-formatting.php b/fp-includes/core/core.wp-formatting.php index 2ef0e69..f4e9471 100644 --- a/fp-includes/core/core.wp-formatting.php +++ b/fp-includes/core/core.wp-formatting.php @@ -9,11 +9,11 @@ $output = ''; // Capture tags and everything inside them $textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); - $stop = count($textarr); $next = true; // loop stuff + $stop = count($textarr); $skip = 0; // loop stuff for ($i = 0; $i < $stop; $i++) { $curl = $textarr[$i]; - if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag + if (isset($curl{0}) && '<' != $curl{0} && $skip == 0) { // If it's not a tag $curl = str_replace('---', '—', $curl); $curl = str_replace(' -- ', ' — ', $curl); $curl = str_replace('--', '–', $curl); @@ -46,12 +46,13 @@ $curl = str_replace("''", '”', $curl); $curl = preg_replace('/(\d+)x(\d+)/', "$1×$2", $curl); - + } elseif (strstr($curl, '')) { + if ($skip > 0) $skip--; } elseif (strstr($curl, ' 0) $skip++; } $curl = preg_replace('/&([^#])(?![a-z12]{1,8};)/', '&$1', $curl); $output .= $curl;