further refinement to highlight_code()'s regex replacements
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 2a42cba..20bf323 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -280,9 +280,8 @@
$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.