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

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 17 Jan 2007 10:09:27 -0000


foxr		Wed Jan 17 05:09:27 2007 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  When <a href=yadayada></a> are in problems, output the
  href or the name if it does not exist in parens.  This 
  sort of points out what's happening in bug 4273...
  and is maybe useful for people so that if they are working
  on printed output but have a computer available they know
  what to point their browsers at.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.350 loncom/xml/londefdef.pm:1.351
--- loncom/xml/londefdef.pm:1.350	Mon Jan  8 14:09:23 2007
+++ loncom/xml/londefdef.pm	Wed Jan 17 05:09:26 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.350 2007/01/08 19:09:23 albertel Exp $
+# $Id: londefdef.pm,v 1.351 2007/01/17 10:09:26 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1559,17 +1559,6 @@
 	my $href=&Apache::lonxml::get_param('href',$parstack,$safeeval,
 					    undef,1);
 	$currentstring=&Apache::lonenc::encrypt_ref($token,{'href'=>$href});
-    } elsif ($target eq 'tex') {
-	my $a=&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1);
-	my $b=&Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1);
-	if ($a=~/\S/) {
-	    $a=~s/([^\\])%/$1\\\%/g;
-	    $currentstring .= '\ref{URI: '.$a.'}';
-	} elsif ($b=~/\S/) {
-	    $currentstring .= '\ref{Anchor: '.$b.'}';
-	} else {
-	    $currentstring.='';
-	}
     }
     return $currentstring;
 }
@@ -1580,6 +1569,18 @@
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring .= $token->[2];
     }
+    if ($target eq 'tex') {
+	my $a=&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1);
+	my $b=&Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1);
+	if ($a=~/\S/) {
+	    $a=~s/([^\\])%/$1\\\%/g;
+	    $currentstring .= ' ({\tt URI:'.&Apache::lonxml::latex_special_symbols($a).'})';
+	} elsif ($b=~/\S/) {
+	    $currentstring .= ' ({\tt Anchor:'.&Apache::lonxml::latex_special_symbols($b).'})';
+	} else {
+	    $currentstring.='';
+	}	
+    }
     return $currentstring;
 }