--- loncom/xml/londefdef.pm 2003/09/05 19:35:40 1.171 +++ loncom/xml/londefdef.pm 2003/09/25 16:09:14 1.173 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.171 2003/09/05 19:35:40 sakharuk Exp $ +# $Id: londefdef.pm,v 1.173 2003/09/25 16:09:14 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1654,29 +1654,37 @@ sub end_dl { return $currentstring; } -#--
tag +#--
tag (end tag optional) sub start_dt { - my ($target,$token) = @_; - my $currentstring = ''; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; + my $currentstring=''; if ($target eq 'web') { $currentstring = $token->[4]; } elsif ($target eq 'tex') { - $currentstring = '\item['; + &Apache::lonxml::startredirection();; } return $currentstring; } sub end_dt { - my ($target,$token) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; my $currentstring = ''; if ($target eq 'web') { $currentstring = $token->[2]; } elsif ($target eq 'tex') { - $currentstring = ']'; + my $data=&item_cleanup; + $currentstring.='\item['.$data.']'; } return $currentstring; } +sub item_cleanup { + my $item=&Apache::lonxml::endredirection();; + $item=~s/\\begin{center}//g; + $item=~s/\\end{center}//g; + return $item; +} + #--
tag sub start_dd { my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; @@ -1684,10 +1692,9 @@ sub start_dd { if ($target eq 'web') { $currentstring = $token->[4]; } elsif ($target eq 'tex') { - if ($$tagstack[-2] eq 'dl') { - $currentstring = ' \item [] '; - } elsif ($$tagstack[-2] eq 'dt') { - $currentstring = ']'; + if ($$tagstack[-2] eq 'dt') { + my $data=&item_cleanup; + $currentstring.='\item['.$data.']'; } } return $currentstring;