--- loncom/xml/londefdef.pm 2001/08/06 20:41:22 1.32 +++ loncom/xml/londefdef.pm 2001/11/06 00:02:25 1.33 @@ -28,31 +28,35 @@ sub end_output { return ''; } #-- tag - sub start_m { - my ($target,$token,$tagstack,$parstack,$parser) = @_; - my $currentstring = ''; - if ($target eq 'web') { - my $inside = &Apache::lonxml::get_all_text("/m",$$parser[$#$parser]); - $inside ='\\documentstyle{article}'.$inside; -# &Apache::lonxml::debug($inside); - $currentstring = &Apache::lontexconvert::converted(\$inside); -# &Apache::lonxml::debug($currentstring); - - } elsif ($target eq 'tex') { - $currentstring = ""; - } - return $currentstring; - } - sub end_m { - my ($target,$token) = @_; - my $currentstring = ''; - if ($target eq 'web') { - } elsif ($target eq 'tex') { - $currentstring = ""; - } elsif ($target eq 'meta') { - } - return $currentstring; - } +sub start_m { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; + my $currentstring = ''; + if ($target eq 'web') { + my $inside = &Apache::lonxml::get_all_text("/m",$$parser[-1]); + $inside ='\\documentstyle{article}'.$inside; + #&Apache::lonxml::debug("M is starting with:$inside:"); + my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); + if ($eval eq 'on') { + $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]); + #&Apache::lonxml::debug("M is evaulated to:$inside:"); + } + $currentstring = &Apache::lontexconvert::converted(\$inside); + #&Apache::lonxml::debug("M is ends with:$currentstring:"); + } elsif ($target eq 'tex') { + $currentstring = ""; + } + return $currentstring; +} +sub end_m { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + } elsif ($target eq 'tex') { + $currentstring = ""; + } elsif ($target eq 'meta') { + } + return $currentstring; +} #-------------------------------------------------------------------------- tag sub start_html { my ($target,$token) = @_; @@ -266,9 +270,7 @@ sub end_output { } my $onLoad=''; foreach my $key (keys(%{$token->[2]})) { - &Apache::lonxml::debug("testing $key"); if ($key =~ /^onload$/i) { - &Apache::lonxml::debug("I like $key"); $onLoad.=$token->[2]->{$key}.';'; delete($token->[2]->{$key}); }