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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 10 Feb 2004 18:58:26 -0000


albertel		Tue Feb 10 13:58:26 2004 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - publishing things like
    <display>&web('','','<p>'></display>
    we cause part metadata to not be generated 
  
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.106 loncom/xml/scripttag.pm:1.107
--- loncom/xml/scripttag.pm:1.106	Fri Jan 16 14:46:03 2004
+++ loncom/xml/scripttag.pm	Tue Feb 10 13:58:26 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.106 2004/01/16 19:46:03 albertel Exp $
+# $Id: scripttag.pm,v 1.107 2004/02/10 18:58:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -109,7 +109,7 @@
     } elsif ( $target eq 'web' || $target eq 'tex' ||
 	      $target eq 'grade' || $target eq 'answer' ||
 	      $target eq 'analyze' ) {
-	my $bodytext=&Apache::lonxml::get_all_text("/script",$parser);
+	my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser);
 	if (!$Apache::lonxml::default_homework_loaded) {
 	    &Apache::lonxml::default_homework_load($safeeval);
 	}
@@ -129,14 +129,16 @@
     } elsif ($target eq "edit" ) {
       #&Apache::run::run($bodytext,$safeeval);
       #$result="<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";
-	my $bodytext=&Apache::lonxml::get_all_text("/script",$parser);
+	my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser);
 	$result=&Apache::edit::tag_start($target,$token,'Script');
 	$result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4);
+    } elsif ($target eq 'meta') {
+	my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/script",$parser);
     }
   } else {
     if ($target ne "meta") {
       $result = $token->[4];
-      my $bodytext=&Apache::lonxml::get_all_text("/script",$parser);
+      my $bodytext=&Apache::lonxml::get_all_text_unblanaced("/script",$parser);
       $result.=$bodytext;
     }
   }
@@ -169,7 +171,7 @@
   } elsif ( $target eq 'web' || $target eq 'tex' ||
 	    $target eq 'grade' || $target eq 'answer' ||
 	      $target eq 'analyze') {
-      my $bodytext=&Apache::lonxml::get_all_text("/display",$parser);
+      my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/display",$parser);
       if (!$Apache::lonxml::default_homework_loaded) {
 	  &Apache::lonxml::default_homework_load($safeeval);
       }
@@ -180,12 +182,14 @@
       }
       $Apache::lonxml::post_evaluate=0;
   } elsif ($target eq "edit" ) {
-    my $bodytext=&Apache::lonxml::get_all_text("/display",$parser);
+    my $bodytext=&Apache::lonxml::get_all_text_unblanced("/display",$parser);
     #$result = 
     #  "<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";
     #$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1);
     $result=&Apache::edit::tag_start($target,$token,'Script With Display');
     $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,1)
+  } elsif ($target eq 'meta') {
+      my $bodytext=&Apache::lonxml::get_all_text_unbalanced("/display",$parser);
   }
   return $result;
 }