From 337c74ab2af0dec69659f8c68c82b12c878c1b88 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 3 Oct 2008 19:09:53 +0000 Subject: tweak of temp tag and highlighting replacement to accommodate environments with different colors specified for highlight_string() --- system/helpers/text_helper.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 54ef1b580..9f13896ae 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -287,12 +287,11 @@ if ( ! function_exists('highlight_code')) { $str = str_replace(array(''), array(''), $str); $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); - $str = str_replace('<?php ', '', $str); } - + // Remove our artificially added PHP, and the syntax highlighting that came with it - $str = str_replace('<?php ', '', $str); - $str = preg_replace('/(.*?)\?><\/span>\n<\/span>\n<\/code>/is', "$1\n\n", $str); + $str = preg_replace('/<\?php( | )/i', '', $str); + $str = preg_replace('/(.*?)\?><\/span>\n<\/span>\n<\/code>/is', "$1\n\n", $str); $str = preg_replace('/<\/span>/i', '', $str); // Replace our markers back to PHP tags. -- cgit v1.2.3-24-g4f1b