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

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 09 Nov 2003 01:19:47 -0000


albertel		Sat Nov  8 20:19:47 2003 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  - BUG#1894, now redfing <m> should work fine, I have also tested putting some odd things inside the <m> tag including the things that caused the original report thacaused the generaation of get_all_text_unbalanced, it seems it is no longer needed.
  
  
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.189 loncom/xml/londefdef.pm:1.190
--- loncom/xml/londefdef.pm:1.189	Fri Oct 24 17:48:17 2003
+++ loncom/xml/londefdef.pm	Sat Nov  8 20:19:47 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.189 2003/10/24 21:48:17 albertel Exp $
+# $Id: londefdef.pm,v 1.190 2003/11/09 01:19:47 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -82,11 +82,12 @@
 }
 #-- <m> tag
 sub start_m {
-    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_;
     my $currentstring = '';
+    my $inside = &Apache::lonxml::get_all_text("/m",$parser,$style);
+    $inside=~s-<LONCAPA_INTERNAL_TURN_STYLE_ON />--g;
     if ($target eq 'web') {
 	$Apache::lonxml::prevent_entity_encode++;
-	my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
 	$inside ='\\documentstyle{article}'.$inside;
 	&Apache::lonxml::debug("M is starting with:$inside:");
 	my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
@@ -103,15 +104,13 @@
 	#&Apache::lonxml::debug("M is ends with:$currentstring:");
 	$Apache::lonxml::post_evaluate=0;
     } elsif ($target eq 'tex') {
-	$currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
+	$currentstring = $inside;
 	my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
 	if ($eval eq 'on') {
 	    $currentstring=&Apache::run::evaluate($currentstring,$safeeval,$$parstack[-1]);
 	}
 	if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';}
 	$Apache::lonxml::post_evaluate=0;
-    } else {
-	my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
     }
     return $currentstring;
 }