[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 05 Jul 2005 18:15:27 -0000
albertel Tue Jul 5 14:15:27 2005 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
- fixing bug #4190 hoepfully for good, replace all ws with a single whitspace, while hopefully preserving the fact the ws contained a newline
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.376 loncom/interface/lonprintout.pm:1.377
--- loncom/interface/lonprintout.pm:1.376 Sat Jun 4 16:52:37 2005
+++ loncom/interface/lonprintout.pm Tue Jul 5 14:15:25 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.376 2005/06/04 20:52:37 albertel Exp $
+# $Id: lonprintout.pm,v 1.377 2005/07/05 18:15:25 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -650,7 +650,8 @@
$first_comment = index($result,'<!--',$first_comment);
}
$result =~ s/^\s+$//gm; #remove empty lines
- $result =~ s/(\s)(\s+)/$1/g; #removes more than one empty space
+ #removes more than one empty space
+ $result =~ s|(\s\s+)|($1=~/[\n\r]/)?"\n":" "|ge;
$result =~ s/\\\\\s*\\vskip/\\vskip/gm;
$result =~ s/\\\\\s*\\noindent\s*(\\\\)+/\\\\\\noindent /g;
$result =~ s/{\\par }\s*\\\\/\\\\/gm;