[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 13 Nov 2004 08:56:54 -0000


albertel		Sat Nov 13 03:56:54 2004 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  <dd> wit no <dt> blew up
  reformat so it looks a littel better on print out
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.243 loncom/xml/londefdef.pm:1.244
--- loncom/xml/londefdef.pm:1.243	Mon Oct 18 18:02:02 2004
+++ loncom/xml/londefdef.pm	Sat Nov 13 03:56:53 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.243 2004/10/18 22:02:02 albertel Exp $
+# $Id: londefdef.pm,v 1.244 2004/11/13 08:56:53 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -66,6 +66,7 @@
     undef(@Apache::londefdef::description);
     @Apache::londefdef::DD=(0);
     @Apache::londefdef::DT=(0);
+    @Apache::londefdef::seenDT=(0);
     $Apache::londefdef::list_index=0;
 }
 
@@ -478,6 +479,7 @@
 sub start_body {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
+
     if ($target eq 'web') {
 	if ($Apache::lonhomework::parsing_a_problem) {
 	    &Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems.");
@@ -1701,6 +1703,7 @@
 	push(@Apache::londefdef::description,[]);
 	$Apache::londefdef::DD[$Apache::londefdef::DL]=0;
 	$Apache::londefdef::DT[$Apache::londefdef::DL]=0;
+	$Apache::londefdef::seenDT[$Apache::londefdef::DL]=0;
     } 
     return $currentstring;
 }
@@ -1720,6 +1723,7 @@
 	$currentstring.='\end{description}';  
 	delete($Apache::londefdef::DD[$Apache::londefdef::DL]);
 	delete($Apache::londefdef::DT[$Apache::londefdef::DL]);
+	delete($Apache::londefdef::seenDT[$Apache::londefdef::DL]);
 	$Apache::londefdef::DL--;
     } 
     return $currentstring;
@@ -1736,6 +1740,7 @@
 	if ($Apache::londefdef::DD[-1]) { &end_dd(@_); }
 	&Apache::lonxml::startredirection();
 	$Apache::londefdef::DT[-1]++;
+	$Apache::londefdef::seenDT[-1]=1;
     } 
     return $currentstring;
 }
@@ -1748,7 +1753,7 @@
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::DT[-1]) {
 	    my $data=&item_cleanup();
-	    push(@{$Apache::londefdef::description[-1]},'\item['.$data.']');
+	    push(@{$Apache::londefdef::description[-1]},'\item['.$data.'] \strut \vskip 0mm');
 	    $Apache::londefdef::DT[-1]--;
 	}
     } 
@@ -1771,6 +1776,9 @@
     } elsif ($target eq 'tex') {
 	if ($Apache::londefdef::DT[-1]) { &end_dt(@_); }
 	if ($Apache::londefdef::DD[-1]) { &end_dd(@_);}
+	if (!$Apache::londefdef::seenDT[-1]) {
+	    push(@{$Apache::londefdef::description[-1]},'\item[\strut] \strut \vskip 0mm ');
+	}
 	push(@{$Apache::londefdef::description[-1]},'');
 	$Apache::londefdef::description[-1]->[-1].=' \strut ';
 	$Apache::londefdef::DD[-1]++;