diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-01-22 21:12:47 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-01-22 21:12:47 +0100 |
commit | 9cee79136d2b197584bc6e076e7df5d69344be1c (patch) | |
tree | a64338d8ac15e7a618a634cdd826248e7c079c79 | |
parent | e352549535beda0ba2be97a437c694d9f794fd4b (diff) |
further refinement to highlight_code()'s regex replacements
-rw-r--r-- | system/helpers/text_helper.php | 5 |
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.
|