Changeset 53 for branches/geshi_highlight
- Timestamp:
- 02/16/09 14:39:14 (3 years ago)
- Files:
-
- 1 modified
-
branches/geshi_highlight/manifest.xml (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/geshi_highlight/manifest.xml
r44 r53 4 4 <id>geshi_highlight</id> 5 5 <title>GeSHi Highlight</title> 6 <version>1.0. 2</version>6 <version>1.0.3</version> 7 7 <description>Highlights code tags in posts using GeSHi highlighter.</description> 8 8 <author>Daris</author> … … 20 20 if (!function_exists('htmlspecialchars_decode')) 21 21 { 22 function htmlspecialchars_decode($str )22 function htmlspecialchars_decode($str, $quote_style = ENT_COMPAT) 23 23 { 24 return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS )));24 return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); 25 25 } 26 26 } … … 29 29 { 30 30 $lang = $matches[1]; 31 $source = htmlspecialchars_decode(trim($matches[2])); 31 $source = htmlspecialchars_decode(trim($matches[2]), ENT_QUOTES); 32 $source = str_replace(''', '\'', $source); // geshi uses ' as single quote instead of ' 32 33 $geshi = new GeSHi($source, $lang); 33 34 $code = $geshi->parse_code(); 34 $code = substr($code, strpos($code, 'monospace;">') + 12); 35 $code = substr($code, 0, strpos($code, '</pre>')); 36 return '[code]'.$code.'[/code]'; 35 return '</p><div class="codebox">'.$code.'</div><p>'; 37 36 } 38 37