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

foxr lon-capa-cvs-allow@mail.lon-capa.org
Thu, 10 May 2007 09:50:10 -0000


foxr		Thu May 10 05:50:10 2007 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Allow hyphenation in printouts of uri's at the /'s.
  (BZ 4723)
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.364 loncom/xml/londefdef.pm:1.365
--- loncom/xml/londefdef.pm:1.364	Fri Apr  6 06:41:45 2007
+++ loncom/xml/londefdef.pm	Thu May 10 05:50:10 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.364 2007/04/06 10:41:45 foxr Exp $
+# $Id: londefdef.pm,v 1.365 2007/05/10 09:50:10 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1609,7 +1609,11 @@
 	    &Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1);
 	if ($href =~ /\S/) {
 	    $href =~ s/([^\\])%/$1\\\%/g;
-	    $currentstring .= ' ({\tt URI:'.&Apache::lonxml::latex_special_symbols($href).'})';
+	    # Substitute special symbols... and allow line breaks at each /
+	    #
+	    $href = &Apache::lonxml::latex_special_symbols($href);
+	    $href =~ s/\//\/\\-/g;              # Map / to /\- to allow hyphenation.
+	    $currentstring .= ' ({\tt URI:'.$href.'})';
 	} elsif ($name =~ /\S/) {
 	    $currentstring .= ' ({\tt Anchor:'.&Apache::lonxml::latex_special_symbols($name).'})';
 	} else {