version 1.20, 2003/03/13 16:16:07
|
version 1.26, 2003/10/07 17:52:29
|
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 127 sub footer {
|
Line 129 sub footer {
|
|
|
sub to_convert { |
sub to_convert { |
my ($string) = @_; |
my ($string) = @_; |
$string=~s/\<br\s*\/?\>/ /g; |
$string=~s/\<br\s*\/?\>/ /gs; |
|
$string=~s/\s/ /gs; |
$string=&HTML::Entities::decode($string); |
$string=&HTML::Entities::decode($string); |
return &converted(\$string); |
return &converted(\$string); |
} |
} |
Line 142 sub smiley {
|
Line 145 sub smiley {
|
'\:\-*(o|O|\(\))' => 'shocked', |
'\:\-*(o|O|\(\))' => 'shocked', |
'\;\-*\)' => 'wink', |
'\;\-*\)' => 'wink', |
'\:\-*P' => 'baeh', |
'\:\-*P' => 'baeh', |
'\:\-*(\\\|\\/)' => 'hrrm', |
'\:\-(\\\|\\/)' => 'hrrm', |
'\:\-*D' => 'bigsmile', |
'\:\-*D' => 'bigsmile', |
'\:\-*C' => 'angry', |
'\:\-*C' => 'angry', |
'\:(\'|\`)\-*\(' => 'cry', |
'\:(\'|\`)\-*\(' => 'cry', |
Line 174 sub msgtexconverted {
|
Line 177 sub msgtexconverted {
|
&tth::tthoptions('-L -u0'); |
&tth::tthoptions('-L -u0'); |
} |
} |
} |
} |
$message=~s/(\$\$.+?\$\$)/&to_convert($1)/ge; |
my $outmessage=''; |
$message=~s/(\$.+?\$)/&to_convert($1)/ge; |
my $tex=0; |
$message=~s/(\\\(.+?\\\))/&to_convert($1)/ge; |
foreach (split(/(?:\<\;|\<)\/*m\s*(?:\>\;|\>)/i,$message)) { |
$message=~s/(\\\[.+?\\\])/&to_convert($1)/ge; |
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; |