[LON-CAPA-cvs] cvs: loncom /xml lontexconvert.pm

www lon-capa-cvs@mail.lon-capa.org
Sat, 19 Apr 2003 20:32:24 -0000


www		Sat Apr 19 16:32:24 2003 EDT

  Modified files:              
    /loncom/xml	lontexconvert.pm 
  Log:
  Bug 1316: tth has problems with linebreaks in formulas. Replaced linebreaks
  by space.
  
  
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.21 loncom/xml/lontexconvert.pm:1.22
--- loncom/xml/lontexconvert.pm:1.21	Mon Mar 31 11:34:08 2003
+++ loncom/xml/lontexconvert.pm	Sat Apr 19 16:32:24 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # TeX Conversion Module
 #
-# $Id: lontexconvert.pm,v 1.21 2003/03/31 16:34:08 www Exp $
+# $Id: lontexconvert.pm,v 1.22 2003/04/19 20:32:24 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -127,7 +127,8 @@
 
 sub to_convert {
     my ($string) = @_;
-    $string=~s/\<br\s*\/?\>/ /g;
+    $string=~s/\<br\s*\/?\>/ /gs;
+    $string=~s/\s/ /gs;
     $string=&HTML::Entities::decode($string);
     return &converted(\$string);
 }
@@ -174,10 +175,10 @@
 	    &tth::tthoptions('-L -u0');
 	}
     }
-    $message=~s/(\$\$.+?\$\$)/&to_convert($1)/ge;
-    $message=~s/(\$.+?\$)/&to_convert($1)/ge;
-    $message=~s/(\\\(.+?\\\))/&to_convert($1)/ge;
-    $message=~s/(\\\[.+?\\\])/&to_convert($1)/ge;
+    $message=~s/(\$\$.+?\$\$)/&to_convert($1)/gse;
+    $message=~s/(\$.+?\$)/&to_convert($1)/gse;
+    $message=~s/(\\\(.+?\\\))/&to_convert($1)/gse;
+    $message=~s/(\\\[.+?\\\])/&to_convert($1)/gse;
     return &smiley($message).$errorstring;
 }