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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 25 Sep 2003 16:09:15 -0000


sakharuk		Thu Sep 25 12:09:15 2003 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Better version of definition list which allows to generalization in the future (if neccessary for the different combinations of tags).
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.172 loncom/xml/londefdef.pm:1.173
--- loncom/xml/londefdef.pm:1.172	Thu Sep 25 11:52:57 2003
+++ loncom/xml/londefdef.pm	Thu Sep 25 12:09:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.172 2003/09/25 15:52:57 sakharuk Exp $
+# $Id: londefdef.pm,v 1.173 2003/09/25 16:09:14 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1672,14 +1672,19 @@
     if ($target eq 'web') {
 	$currentstring = $token->[2];    
     } elsif ($target eq 'tex') {
-	my $data=&Apache::lonxml::endredirection();
-	$data=~s/\\begin{center}//g;
-	$data=~s/\\end{center}//g;
+	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;
+}
+
 #-- <dd> tag
 sub start_dd {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
@@ -1688,7 +1693,8 @@
 	$currentstring = $token->[4];     
     } elsif ($target eq 'tex') {
 	if ($$tagstack[-2] eq 'dt') {
-	    $currentstring.='\item['.&Apache::lonxml::endredirection().']';
+	    my $data=&item_cleanup;
+	    $currentstring.='\item['.$data.']';
 	}
     } 
     return $currentstring;