--- loncom/xml/lontexconvert.pm 2003/04/19 20:32:24 1.22 +++ loncom/xml/lontexconvert.pm 2003/06/23 21:28:59 1.24 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.22 2003/04/19 20:32:24 www Exp $ +# $Id: lontexconvert.pm,v 1.24 2003/06/23 21:28:59 albertel 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 '[Uncoverted Due To Previous Errors]'; + return '[TeX Uncoverted Due To Previous Errors]'; } eval(<<'ENDCONV'); { @@ -98,6 +98,8 @@ sub converted { $xmlstring=&tth::tth($$texstring); $errorstring.=&tth::ttherror(); } + $xmlstring=~s/^\s*//; + $xmlstring=~s/\s*$//; } ENDCONV if ($Apache::lontexconvert::messedup || &tth::tthmessedup()) { @@ -179,7 +181,11 @@ sub msgtexconverted { $message=~s/(\$.+?\$)/&to_convert($1)/gse; $message=~s/(\\\(.+?\\\))/&to_convert($1)/gse; $message=~s/(\\\[.+?\\\])/&to_convert($1)/gse; - return &smiley($message).$errorstring; + if (wantarray) { + return (&smiley($message),$errorstring); + } else { + return &smiley($message).$errorstring; + } } 1;