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

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 30 Jun 2003 18:54:02 -0000


sakharuk		Mon Jun 30 14:54:02 2003 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Corrections to print links (the source of this corrections - particular document res/msu/bio/bswelcomeLON-CAPA.html). This html page is a perfect example how to create bad html and absolutely unreasonably complicated document. I have still to work with this html page - the content of this page is embedded into one cell of one column page and LaTeX has a severe limitations for such huge tables. 
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.148 loncom/xml/londefdef.pm:1.149
--- loncom/xml/londefdef.pm:1.148	Mon Jun 30 11:05:54 2003
+++ loncom/xml/londefdef.pm	Mon Jun 30 14:54:02 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.148 2003/06/30 15:05:54 sakharuk Exp $
+# $Id: londefdef.pm,v 1.149 2003/06/30 18:54:02 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1292,7 +1292,7 @@
     if ($target eq 'web') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
-	my $LaTeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,0);
+	my $LaTeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0);
 	if (defined $LaTeXwidth) {
 	    if ($LaTeXwidth=~/^%/) {
 		substr($LaTeXwidth,0,1)='';
@@ -1346,11 +1346,14 @@
 
 #-- <a> tag
 sub start_a {
-    my ($target,$token) = @_;
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
     if ($target eq 'web') {
 	$currentstring .= $token->[4];
     } elsif ($target eq 'tex') {
+	my $a=&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1);
+	$a=~s/([^\\])%/$1\\\%/g;
+	$currentstring .= '\ref{'.$a.'}';
     }
     return $currentstring;
 }
@@ -1360,9 +1363,6 @@
     my $currentstring = '';
     if ($target eq 'web') {
 	$currentstring .= $token->[2];
-    } elsif ($target eq 'tex') {
-	my $href=&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1);
-	$currentstring .= '\ref{'.$href.'}';
     }
     return $currentstring;
 }