--- loncom/xml/lontexconvert.pm 2003/06/23 21:28:59 1.24 +++ loncom/xml/lontexconvert.pm 2003/10/07 17:52:29 1.26 @@ -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.26 2003/10/07 17:52:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -83,7 +83,7 @@ sub converted { my $texstring=shift; my $xmlstring='[UNDISPLAYABLE]'; if ($Apache::lontexconvert::messedup) { - return '[TeX Uncoverted Due To Previous Errors]'; + return '[TeX Unconverted Due To Previous Errors]'; } eval(<<'ENDCONV'); { @@ -177,14 +177,19 @@ sub msgtexconverted { &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(/(?:\<\;|\<)\/*m\s*(?:\>\;|\>)/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; } }