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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 16 Jul 2002 15:02:31 -0000


sakharuk		Tue Jul 16 11:02:31 2002 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  Some special symbols now sows up correctly in both html and latex.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.181 loncom/xml/lonxml.pm:1.182
--- loncom/xml/lonxml.pm:1.181	Mon Jul 15 15:45:18 2002
+++ loncom/xml/lonxml.pm	Tue Jul 16 11:02:31 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.181 2002/07/15 19:45:18 www Exp $
+# $Id: lonxml.pm,v 1.182 2002/07/16 15:02:31 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -546,7 +546,17 @@
     while ($token = $$pars['-1']->get_token) {
       if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) {
 	if ($metamode<1) {
-	  $result=$token->[1];
+	    if ($target eq 'tex') {
+		my @temp_array = @$stack;
+		if ($temp_array[-1] ne 'm') {
+		    if ($temp_array[-1] ne 'tt') {
+			if ($token->[1]=~m/\^/) {$token->[1]=~s/\^/\\verb|\^|/g;}
+		    } else {
+			if ($token->[1]=~m/\^/) {$token->[1]=~s/\^/}\\verb|\^|{/g;}
+		    }
+		}
+	    }
+	  $result.=$token->[1];
 	}
       } elsif ($token->[0] eq 'PI') {
 	if ($metamode<1) {