version 1.22, 2003/04/19 20:32:24
|
version 1.27, 2003/10/18 15:53:00
|
Line 83 sub converted {
|
Line 83 sub converted {
|
my $texstring=shift; |
my $texstring=shift; |
my $xmlstring='[UNDISPLAYABLE]'; |
my $xmlstring='[UNDISPLAYABLE]'; |
if ($Apache::lontexconvert::messedup) { |
if ($Apache::lontexconvert::messedup) { |
return '[Uncoverted Due To Previous Errors]'; |
return '[TeX Unconverted Due To Previous Errors]'; |
} |
} |
eval(<<'ENDCONV'); |
eval(<<'ENDCONV'); |
{ |
{ |
Line 98 sub converted {
|
Line 98 sub converted {
|
$xmlstring=&tth::tth($$texstring); |
$xmlstring=&tth::tth($$texstring); |
$errorstring.=&tth::ttherror(); |
$errorstring.=&tth::ttherror(); |
} |
} |
|
$xmlstring=~s/^\s*//; |
|
$xmlstring=~s/\s*$//; |
} |
} |
ENDCONV |
ENDCONV |
if ($Apache::lontexconvert::messedup || &tth::tthmessedup()) { |
if ($Apache::lontexconvert::messedup || &tth::tthmessedup()) { |
Line 136 sub to_convert {
|
Line 138 sub to_convert {
|
sub smiley { |
sub smiley { |
my $expression=shift; |
my $expression=shift; |
if ($ENV{'browser.imagesuppress'} eq 'on') { return $expression; } |
if ($ENV{'browser.imagesuppress'} eq 'on') { return $expression; } |
my %smileys=('\:\-*\)' => 'smiley', |
my %smileys=('\:\-\)' => 'smiley', |
'8\-*\)' => 'coolsmile', |
'8\-\)' => 'coolsmile', |
'8\-*I' => 'coolindiff', |
'8\-(I|\|)' => 'coolindiff', |
':\-*\(' => 'frowny', |
':\-(I|\|)' => 'neutral', |
'\:\-*(o|O|\(\))' => 'shocked', |
'\:\-(o|O|\(\))' => 'shocked', |
'\;\-*\)' => 'wink', |
':\-\(' => 'frowny', |
'\:\-*P' => 'baeh', |
'\;\-\)' => 'wink', |
|
'\:\-P' => 'baeh', |
'\:\-(\\\|\\/)' => 'hrrm', |
'\:\-(\\\|\\/)' => 'hrrm', |
'\:\-*D' => 'bigsmile', |
'\:\-D' => 'bigsmile', |
'\:\-*C' => 'angry', |
'\:\-C' => 'angry', |
'\:(\'|\`)\-*\(' => 'cry', |
'\:(\'|\`)\-\(' => 'cry', |
'\:\-*(X|\#)' => 'lipsrsealed', |
'\:\-(X|\#)' => 'lipsrsealed', |
'\:\-*S' => 'huh'); |
'\:\-S' => 'huh'); |
my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; |
my $iconpath=$Apache::lonnet::perlvar{'lonIconsURL'}; |
foreach (keys %smileys) { |
foreach (keys %smileys) { |
$expression=~s/$_/\<img src="$iconpath\/$smileys{$_}.gif" \/\>/gs; |
$expression=~s/$_/\<img src="$iconpath\/$smileys{$_}.gif" \/\>/gs; |
Line 175 sub msgtexconverted {
|
Line 178 sub msgtexconverted {
|
&tth::tthoptions('-L -u0'); |
&tth::tthoptions('-L -u0'); |
} |
} |
} |
} |
$message=~s/(\$\$.+?\$\$)/&to_convert($1)/gse; |
my $outmessage=''; |
$message=~s/(\$.+?\$)/&to_convert($1)/gse; |
my $tex=0; |
$message=~s/(\\\(.+?\\\))/&to_convert($1)/gse; |
foreach (split(/(?:\<\;|\<)\/*m\s*(?:\>\;|\>)/i,$message)) { |
$message=~s/(\\\[.+?\\\])/&to_convert($1)/gse; |
if ($tex) { |
return &smiley($message).$errorstring; |
$outmessage.=&to_convert($_); $tex=0; |
|
} else { |
|
$outmessage.=&smiley($_); $tex=1; |
|
} |
|
} |
|
if (wantarray) { |
|
return ($outmessage,$errorstring); |
|
} else { |
|
return $outmessage.$errorstring; |
|
} |
} |
} |
|
|
1; |
1; |