summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-10-31 20:57:58 +0100
committerFlorian Pritz <bluewind@xinu.at>2011-10-31 20:57:58 +0100
commit854b855a22e61237c20efd5bc38f1c91eba7e19c (patch)
treeea1c2a9f786ffa9c8cf508d18d1e333ad3412506
parentf0fb5945f064ea99c457a56b6cb3973b9c94d66c (diff)
Fix broken <span> at beginning of highlighted diff
If a regex matches on lines that begin with a space, it will create a <span> tag directly at teh beginning of the code. The return statment removes the first char which in this case will be "<" so the html tag will be broken and there will be a left over space. If we don't add the space in the first place, we don't have to remove it. This looks like some crazy workaround, so it might cause problems to appear. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/libraries/geshi.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/application/libraries/geshi.php b/application/libraries/geshi.php
index f6796c9f6..c654fa2a7 100644
--- a/application/libraries/geshi.php
+++ b/application/libraries/geshi.php
@@ -3267,7 +3267,7 @@ class Geshi {
* @todo BUGGY! Why? Why not build string and return?
*/
function parse_non_string_part($stuff_to_parse) {
- $stuff_to_parse = ' ' . $this->hsc($stuff_to_parse);
+ $stuff_to_parse = $this->hsc($stuff_to_parse);
// Highlight keywords
$disallowed_before = "(?<![a-zA-Z0-9\$_\|\#;>|^&";
@@ -3576,7 +3576,7 @@ class Geshi {
$stuff_to_parse = str_replace('<|', '<span', $stuff_to_parse);
$stuff_to_parse = str_replace ( '|>', '</span>', $stuff_to_parse );
- return substr($stuff_to_parse, 1);
+ return $stuff_to_parse;
}
/**