Subject: Gitweb indentation wrong in Internet Explorer

From: Ralf Baechle <[email-masked]>
Date: Wed, 11 Oct 2006 18:25:53 +0100

I have a report from an MSIE suffering user:

> When I use it (and I believe I've seen this on my laptop as well as my
> workstation) all left-hand margin whitespace is collapsed to nothingness.
> Once can still parse the code, but it's harder with no indentations.

A screenshot from a Windows laptop to illustrate the problem is at
http://www.linux-mips.org/~ralf/gitweb.png.  It shows the code was
preformatted correctly which seems to be an IE bug but the following patch
seems to work around it.

*** gitweb.cgi.dist	2006-10-09 19:02:19.561726255 +0100
--- gitweb.cgi	2006-10-09 19:03:31.744837495 +0100
***************
*** 234,239 ****
--- 234,240 ----
  	my $str = shift;
  	$str = decode("utf8", $str, Encode::FB_DEFAULT);
  	$str = escapeHTML($str);
+ 	$str =~ s/ /&nbsp;/g;
  	return $str;
  }

Thanks,

  Ralf