summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-01-22 21:12:47 +0100
committerDerek Jones <derek.jones@ellislab.com>2008-01-22 21:12:47 +0100
commit9cee79136d2b197584bc6e076e7df5d69344be1c (patch)
treea64338d8ac15e7a618a634cdd826248e7c079c79
parente352549535beda0ba2be97a437c694d9f794fd4b (diff)
further refinement to highlight_code()'s regex replacements
-rw-r--r--system/helpers/text_helper.php5
1 files changed, 2 insertions, 3 deletions
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("#\<code\>.+?tempstart\<br />\</span\>#is", "<code>\n", $str);
- $str = preg_replace("#\<code\>.+?tempstart\<br />#is", "<code>\n", $str);
+ // Remove our artificially added PHP
+ $str = preg_replace("#\<code\>.+?tempstart\<br />(?:\</span\>)?#is", "<code>\n", $str);
$str = preg_replace("#tempend.+#is", "</span>\n</code>", $str);
// Replace our markers back to PHP tags.