From 9cee79136d2b197584bc6e076e7df5d69344be1c Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 22 Jan 2008 20:12:47 +0000 Subject: further refinement to highlight_code()'s regex replacements --- system/helpers/text_helper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'system') diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 2a42cba7e..20bf32335 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -280,9 +280,8 @@ function highlight_code($str) $str = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $str); } - // Remove our artificially added PHP and the empty span that results from our temp markers - $str = preg_replace("#\.+?tempstart\
\#is", "\n", $str); - $str = preg_replace("#\.+?tempstart\
#is", "\n", $str); + // Remove our artificially added PHP + $str = preg_replace("#\.+?tempstart\
(?:\)?#is", "\n", $str); $str = preg_replace("#tempend.+#is", "\n", $str); // Replace our markers back to PHP tags. -- cgit v1.2.3-24-g4f1b