[LON-CAPA-cvs] cvs: loncom /xml lontexconvert.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 23 Jun 2003 21:28:59 -0000
albertel Mon Jun 23 17:28:59 2003 EDT
Modified files:
/loncom/xml lontexconvert.pm
Log:
- better error message
- if the calling function wants an array of results pass the errors back seperately
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.23 loncom/xml/lontexconvert.pm:1.24
--- loncom/xml/lontexconvert.pm:1.23 Mon Jun 9 17:37:54 2003
+++ loncom/xml/lontexconvert.pm Mon Jun 23 17:28:59 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# TeX Conversion Module
#
-# $Id: lontexconvert.pm,v 1.23 2003/06/09 21:37:54 albertel 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 @@
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');
{
@@ -181,7 +181,11 @@
$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;