--- loncom/xml/lontexconvert.pm 2003/03/13 16:16:07 1.20
+++ loncom/xml/lontexconvert.pm 2003/06/09 21:37:54 1.23
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# TeX Conversion Module
#
-# $Id: lontexconvert.pm,v 1.20 2003/03/13 16:16:07 www Exp $
+# $Id: lontexconvert.pm,v 1.23 2003/06/09 21:37:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -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()) {
@@ -127,7 +129,8 @@ sub footer {
sub to_convert {
my ($string) = @_;
- $string=~s/\
/ /g;
+ $string=~s/\
/ /gs;
+ $string=~s/\s/ /gs;
$string=&HTML::Entities::decode($string);
return &converted(\$string);
}
@@ -142,7 +145,7 @@ sub smiley {
'\:\-*(o|O|\(\))' => 'shocked',
'\;\-*\)' => 'wink',
'\:\-*P' => 'baeh',
- '\:\-*(\\\|\\/)' => 'hrrm',
+ '\:\-(\\\|\\/)' => 'hrrm',
'\:\-*D' => 'bigsmile',
'\:\-*C' => 'angry',
'\:(\'|\`)\-*\(' => 'cry',
@@ -174,10 +177,10 @@ sub msgtexconverted {
&tth::tthoptions('-L -u0');
}
}
- $message=~s/(\$\$.+?\$\$)/&to_convert($1)/ge;
- $message=~s/(\$.+?\$)/&to_convert($1)/ge;
- $message=~s/(\\\(.+?\\\))/&to_convert($1)/ge;
- $message=~s/(\\\[.+?\\\])/&to_convert($1)/ge;
+ $message=~s/(\$\$.+?\$\$)/&to_convert($1)/gse;
+ $message=~s/(\$.+?\$)/&to_convert($1)/gse;
+ $message=~s/(\\\(.+?\\\))/&to_convert($1)/gse;
+ $message=~s/(\\\[.+?\\\])/&to_convert($1)/gse;
return &smiley($message).$errorstring;
}