--- loncom/xml/londefdef.pm 2001/12/07 22:23:37 1.36 +++ loncom/xml/londefdef.pm 2002/01/06 02:19:25 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.36 2001/12/07 22:23:37 albertel Exp $ +# $Id: londefdef.pm,v 1.38 2002/01/06 02:19:25 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -45,7 +45,7 @@ package Apache::londefdef; use strict; use Apache::lonxml; -sub BEGIN { +BEGIN { &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset')); @@ -70,13 +70,18 @@ sub start_m { 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:"); + &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); + if ($Apache::lontexconvert::errorstring) { + &Apache::lonxml::warning("tth error: ". + $Apache::lontexconvert::errorstring); + $Apache::lontexconvert::errorstring=''; + } #&Apache::lonxml::debug("M is ends with:$currentstring:"); } elsif ($target eq 'tex') { $currentstring = ""; @@ -337,9 +342,9 @@ sub end_m { &Apache::lonxml::unloadevents(); $currentstring .= '<'.$token->[1]; - map { - $currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; - } keys %{$token->[2]}; + foreach (keys %{$token->[2]}) { + $currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; + } $currentstring.='>'; } elsif ($target eq 'tex') { $currentstring = '\begin{document}';