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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 09 Jun 2003 21:37:54 -0000


albertel		Mon Jun  9 17:37:54 2003 EDT

  Modified files:              
    /loncom/xml	lontexconvert.pm run.pm scripttag.pm style.pm 
  Log:
  - how about this instead then.
  
  
  
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.22 loncom/xml/lontexconvert.pm:1.23
--- loncom/xml/lontexconvert.pm:1.22	Sat Apr 19 16:32:24 2003
+++ loncom/xml/lontexconvert.pm	Mon Jun  9 17:37:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # TeX Conversion Module
 #
-# $Id: lontexconvert.pm,v 1.22 2003/04/19 20:32:24 www Exp $
+# $Id: lontexconvert.pm,v 1.23 2003/06/09 21:37:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -98,6 +98,8 @@
       $xmlstring=&tth::tth($$texstring);
       $errorstring.=&tth::ttherror();
     }
+    $xmlstring=~s/^\s*//;
+    $xmlstring=~s/\s*$//;
   }
 ENDCONV
   if ($Apache::lontexconvert::messedup || &tth::tthmessedup()) {
Index: loncom/xml/run.pm
diff -u loncom/xml/run.pm:1.36 loncom/xml/run.pm:1.37
--- loncom/xml/run.pm:1.36	Thu Apr  3 16:58:40 2003
+++ loncom/xml/run.pm	Mon Jun  9 17:37:54 2003
@@ -1,6 +1,6 @@
 package Apache::run;
 #
-# $Id: run.pm,v 1.36 2003/04/03 21:58:40 albertel Exp $
+# $Id: run.pm,v 1.37 2003/06/09 21:37:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -38,6 +38,7 @@
 
 sub evaluate {
     my ($expression,$safeeval,$decls) = @_;
+    &Apache::lonxml::debug("got $expression and decls $decls");
     unless (defined($expression)) { return ''; }
     if ($Apache::lonxml::evaluate < 1) { return $expression; }
     my $result = '';
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.96 loncom/xml/scripttag.pm:1.97
--- loncom/xml/scripttag.pm:1.96	Mon Jun  9 11:46:01 2003
+++ loncom/xml/scripttag.pm	Mon Jun  9 17:37:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.96 2003/06/09 15:46:01 www Exp $
+# $Id: scripttag.pm,v 1.97 2003/06/09 21:37:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -282,15 +282,15 @@
   my $result;
   if ($target eq 'web') {
     my $output=&Apache::lonxml::endredirection;
+    $output =~ s/[\n\r]/ /g;
+    $output = &HTML::Entities::encode($output,'<>&"\'');
+    $output =~ s/&/\\&/g;
     my $linktext= &Apache::lonxml::get_param('linktext',$parstack,$safeeval);
     if (!$linktext) { $linktext='<sup>*</sup>'; }
     my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval);
     if (!$width) { $width='500'; }
     my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
     if (!$height) { $height='200'; }
-    $output =~ s/[\n\r]/ /g;
-    $output =~ s/\'/\\\&\#39\;/g;
-    $output =~ s/\"/\&quot\;/g;
     $result = "<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=$width,height=$height,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor=&quot;#FFFFFF&quot;> $output </body></html>\');newWindow.document.close();void(0);\">$linktext</a>";
   } elsif ($target eq 'tex') {
       $result = '}';
Index: loncom/xml/style.pm
diff -u loncom/xml/style.pm:1.15 loncom/xml/style.pm:1.16
--- loncom/xml/style.pm:1.15	Wed Nov  6 17:48:56 2002
+++ loncom/xml/style.pm	Mon Jun  9 17:37:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Style Parser Module (new version)
 #
-# $Id: style.pm,v 1.15 2002/11/06 22:48:56 albertel Exp $
+# $Id: style.pm,v 1.16 2003/06/09 21:37:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -107,7 +107,7 @@
 ###########
 	if ($current_value) {
 	    push(@values,$current_value);
-	    &Apache::lonxml::debug("a:$current_value: $#values \n");
+	    #&Apache::lonxml::debug("a:$current_value: $#values \n");
 	} else {
 	    pop(@keys);
 	}
@@ -120,7 +120,7 @@
 	push @style_array,$keys[$i],$values[$i]; 
     }
     my %style_for_target =  @style_array;
-
+    &Apache::lonhomework::showhash(%style_for_target);
 # check printing
 #    foreach $current_key (sort keys %style_for_target) {
 #	&Apache::lonxml::debug("$current_key => $style_for_target{$current_key}\n");