--- loncom/xml/lontexconvert.pm 2006/09/07 21:51:16 1.78 +++ loncom/xml/lontexconvert.pm 2006/10/23 18:49:47 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.78 2006/09/07 21:51:16 albertel Exp $ +# $Id: lontexconvert.pm,v 1.79 2006/10/23 18:49:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -267,8 +267,8 @@ sub smiley { '\:\-(X|\#)' => 'lipsrsealed', '\:\-S' => 'huh'); my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; - foreach (keys %smileys) { - $expression=~s/$_/\/gs; + foreach my $smiley (keys(%smileys)) { + $expression=~s/$smiley/\/gs; } return $expression; } @@ -279,27 +279,34 @@ sub msgtexconverted { &init_tth(); my $outmessage=''; my $tex=0; - foreach (split(/(?:\<\;|\<)\/*m\s*(?:\>\;|\>)/i,$message)) { + foreach my $fragment (split(/(?:\<\;|\<)\/*m\s*(?:\>\;|\>)/i,$message)) { if ($tex) { if ($email) { - $outmessage.=''.&to_convert($_).'
'; $tex=0; + $outmessage.=''.&to_convert($fragment).'
'; + $tex=0; } else { - $outmessage.=&to_convert($_); $tex=0; + $outmessage.=&to_convert($fragment); + $tex=0; } } else { - $outmessage.=&smiley($_); $tex=1; + $outmessage.=&smiley($fragment); + $tex=1; } } $message=$outmessage; $outmessage=''; $tex=0; - foreach (split(/(?:\<\;|\<)\/*algebra\s*(?:\>\;|\>)/i,$message)) { + foreach my $fragment (split(/(?:\<\;|\<)\/*algebra\s*(?:\>\;|\>)/i, + $message)) { if ($tex) { if ($email) { - $outmessage.=''.&algebra($_,'web').'
'; $tex=0; + $outmessage.=''.&algebra($fragment,'web').'
'; + $tex=0; } else { - $outmessage.=&algebra($_,'web'); $tex=0; + $outmessage.=&algebra($fragment,'web'); + $tex=0; } } else { - $outmessage.=$_; $tex=1; + $outmessage.=$fragment; + $tex=1; } } if (wantarray) {