Diff for /loncom/xml/londefdef.pm between versions 1.168 and 1.173

version 1.168, 2003/08/26 21:31:19 version 1.173, 2003/09/25 16:09:14
Line 410  sub end_meta { Line 410  sub end_meta {
  my $content=&Apache::lonxml::get_param('content',$parstack,$safeeval);   my $content=&Apache::lonxml::get_param('content',$parstack,$safeeval);
  my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);   my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);
  if ((not defined $content) && (not defined $name)) {   if ((not defined $content) && (not defined $name)) {
     &Apache::lonxml::startredirection();      &Apache::lonxml::endredirection();
  }   }
     }      }
     return $currentstring;      return $currentstring;
Line 466  sub start_body { Line 466  sub start_body {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
    if ($Apache::lonhomework::parsing_a_problem) {
       &Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems.");
       return '';
    }
  if (!$Apache::lonxml::registered) {   if (!$Apache::lonxml::registered) {
     $currentstring.='<head>'.      $currentstring.='<head>'.
  &Apache::lonmenu::registerurl(undef,$target).'</head>';   &Apache::lonmenu::registerurl(undef,$target).'</head>';
Line 537  sub end_body { Line 541  sub end_body {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\end{document}';     $currentstring = '\strut\newline\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\newline\noindent \end{document}';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1650  sub end_dl { Line 1654  sub end_dl {
     return $currentstring;      return $currentstring;
 }  }
   
 #-- <dt> tag  #-- <dt> tag (end tag optional)
 sub start_dt {  sub start_dt {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring='';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\item[';     &Apache::lonxml::startredirection();; 
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
 sub end_dt {  sub end_dt {
     my ($target,$token) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';      my $currentstring = '';
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];       $currentstring = $token->[2];    
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = ']';     my $data=&item_cleanup;
    $currentstring.='\item['.$data.']';
     }       } 
     return $currentstring;      return $currentstring;
 }  }
   
   sub item_cleanup {
       my $item=&Apache::lonxml::endredirection();;
       $item=~s/\\begin{center}//g;
       $item=~s/\\end{center}//g;
       return $item;
   }
   
 #-- <dd> tag  #-- <dd> tag
 sub start_dd {  sub start_dd {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
Line 1680  sub start_dd { Line 1692  sub start_dd {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[4];        $currentstring = $token->[4];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  if ($$tagstack[-2] eq 'dl') {   if ($$tagstack[-2] eq 'dt') {
     $currentstring = ' \item [] ';        my $data=&item_cleanup;
  } elsif ($$tagstack[-2] eq 'dt') {      $currentstring.='\item['.$data.']';
     $currentstring = ']';   
  }   }
     }       } 
     return $currentstring;      return $currentstring;

Removed from v.1.168  
changed lines
  Added in v.1.173


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>