# HG changeset patch # User Dan # Date 1243641199 14400 # Node ID 97d85c22ced7cced539309646464b9835beeb161 # Parent f3e2bbbd21552de052796be48012f9af3e6f7178 Fixed incorrect treatment of . diff -r f3e2bbbd2155 -r 97d85c22ced7 plugins/GeSHi.php --- a/plugins/GeSHi.php Fri May 29 19:40:15 2009 -0400 +++ b/plugins/GeSHi.php Fri May 29 19:53:19 2009 -0400 @@ -47,6 +47,14 @@ function geshi_strip_code(&$text, &$codeblocks, $random_id) { + // remove nowiki + $nw = preg_match_all('#(.*?)<\/nowiki>#is', $text, $nowiki); + + for ( $i = 0; $i < $nw; $i++ ) + { + $text = str_replace(''.$nowiki[1][$i].'', '{NOWIKI:'.$random_id.':'.$i.'}', $text); + } + global $geshi_supported_formats; $codeblocks = array(); $sf = '(' . implode('|', $geshi_supported_formats) . ')'; @@ -68,6 +76,12 @@ ); $text = str_replace_once($match, "{GESHI_BLOCK:$i:$random_id}", $text); } + + // Reinsert sections + for ( $i = 0; $i < $nw; $i++ ) + { + $text = str_replace('{NOWIKI:'.$random_id.':'.$i.'}', $nowiki[1][$i], $text); + } } function geshi_restore_code(&$text, &$codeblocks, $random_id)