The whitespace of the first line is trimmed

e.g. input:

   int a;
   int b;
   int c;

is rendered as

int a;
   int b;
   int c;

Comments

soxofaan’s picture

partially solved by http://drupal.org/cvs?commit=80993
problem still occurs when div is used as code container, but this seems a bug in GeSHi at first sight:

input (underscores represent spaces):

__int a;
__int b;

rendered result (underscores represent spaces):

_int a;
__int b;

in pseudo html (underscores represent spaces):

_ int a;
 _int b;
soxofaan’s picture

Status: Active » Fixed

After some research, this is indeed a bug in GeSHi
reported at http://sourceforge.net/tracker/index.php?func=detail&aid=1800170&group_i...

solution:
change line change line 1983 of geshi.php (version 1.0.7.20) from
$result = str_replace("\n ", "\n ", $result);
to
$result = preg_replace('/^ /m', ' ', $result);

Anonymous’s picture

Status: Fixed » Closed (fixed)