--- loncom/xml/lonxml.pm 2002/08/28 17:07:54 1.189 +++ loncom/xml/lonxml.pm 2002/09/04 03:57:18 1.190 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.189 2002/08/28 17:07:54 sakharuk Exp $ +# $Id: lonxml.pm,v 1.190 2002/09/04 03:57:18 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -566,16 +566,12 @@ sub inner_xmlparse { while ($token = $$pars['-1']->get_token) { if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { if ($metamode<1) { - if ($target eq 'tex') { - my $text=$token->[1]; - if ($token->[0] eq 'C') { - $text = '%'.$text; - $text =~ s/[\n\r]//g; - } - $result.=&latex_special_sumbols($text,$stack,$parstack); - } else { - $result.=$token->[1]; + my $text=$token->[1]; + if ($token->[0] eq 'C') { + $text = '%'.$text; + $text =~ s/[\n\r]//g; } + $result.=$text; } } elsif ($token->[0] eq 'PI') { if ($metamode<1) { @@ -638,6 +634,12 @@ sub inner_xmlparse { $result= &Apache::run::evaluate($result,$safeeval,''); } } + if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { + if ($target eq 'tex') { + $result=&latex_special_sumbols($result,$stack,$parstack); + } + } + # Encode any high ASCII characters if (!$Apache::lonxml::prevent_entity_encode) { $result=&HTML::Entities::encode($result,"\200-\377"); @@ -963,6 +965,7 @@ sub decreasedepth { } sub get_all_text_unbalanced { +#there is a copy of this in lonpublisher.pm my($tag,$pars)= @_; my $token; my $result='';