summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.