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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 24 Oct 2003 21:48:18 -0000


albertel		Fri Oct 24 17:48:18 2003 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  - makes things not break if and img tag with no src= is in there (make it so templates can include the image tag by default without having the web through up broken image links and print go wacky)
  
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.188 loncom/xml/londefdef.pm:1.189
--- loncom/xml/londefdef.pm:1.188	Fri Oct 24 17:31:05 2003
+++ loncom/xml/londefdef.pm	Fri Oct 24 17:48:17 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.188 2003/10/24 21:31:05 albertel Exp $
+# $Id: londefdef.pm,v 1.189 2003/10/24 21:48:17 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2093,6 +2093,11 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,
 					 undef,1);
+    if (not $src and ($target eq 'web' or $target eq 'tex')) { 
+	my $inside = &Apache::lonxml::get_all_text("/img",$parser);
+	&Apache::lonnet::logthis("inside was $inside");
+	return '';
+    }
     $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src;
     my $currentstring = '';
     my $width_param = '';
@@ -2211,6 +2216,7 @@
 						     $safeeval,'src','alt',
 						     'TeXwidth','TeXheight',
 						     'width','height');
+	$src=$token->[2]{'src'};
 	if (!$token->[2]{'width'} && !$token->[2]{'height'}) {
 	    $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
 	    &image_replication($src);