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

www lon-capa-cvs@mail.lon-capa.org
Fri, 19 Sep 2003 16:12:50 -0000


www		Fri Sep 19 12:12:50 2003 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
    /loncom/xml	lontexconvert.pm 
  Log:
  Bugs #1960 and #2156: <m> in CHAT and FDBK, just like everywhere else. 
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.60 loncom/interface/lonfeedback.pm:1.61
--- loncom/interface/lonfeedback.pm:1.60	Wed Sep 17 14:16:39 2003
+++ loncom/interface/lonfeedback.pm	Fri Sep 19 12:12:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.60 2003/09/17 18:16:39 albertel Exp $
+# $Id: lonfeedback.pm,v 1.61 2003/09/19 16:12:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -365,14 +365,14 @@
       # allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> 
       # <BLOCKQUOTE> <DIV .*> <DIV> <IMG>
       my %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,
-		BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1);
+		BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,
+                M=>1);
 
       $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
 	  {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;
       $message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/
 	  {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;
   } else {
-      $message=~s/\<\/*m\s*\>//g;
       $message=~s/\</\&lt\;/g;
       $message=~s/\>/\&gt\;/g;
   }
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.24 loncom/xml/lontexconvert.pm:1.25
--- loncom/xml/lontexconvert.pm:1.24	Mon Jun 23 17:28:59 2003
+++ loncom/xml/lontexconvert.pm	Fri Sep 19 12:12:50 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # TeX Conversion Module
 #
-# $Id: lontexconvert.pm,v 1.24 2003/06/23 21:28:59 albertel Exp $
+# $Id: lontexconvert.pm,v 1.25 2003/09/19 16:12:50 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -177,14 +177,19 @@
 	    &tth::tthoptions('-L -u0');
 	}
     }
-    $message=~s/(\$\$.+?\$\$)/&to_convert($1)/gse;
-    $message=~s/(\$.+?\$)/&to_convert($1)/gse;
-    $message=~s/(\\\(.+?\\\))/&to_convert($1)/gse;
-    $message=~s/(\\\[.+?\\\])/&to_convert($1)/gse;
+    my $outmessage='';
+    my $tex=0;
+    foreach (split(/(?:\&lt\;|\<)\/*m\s*(?:\&gt\;|\>)/i,$message)) {
+	if ($tex) {
+	    $outmessage.=&to_convert($_); $tex=0;
+	} else {
+            $outmessage.=&smiley($_); $tex=1;
+	}
+    }
     if (wantarray) {
-	return (&smiley($message),$errorstring);
+	return ($outmessage,$errorstring);
     } else {
-	return &smiley($message).$errorstring;
+	return $outmessage.$errorstring;
     }
 }