--- loncom/xml/lonxml.pm 2004/07/07 20:43:20 1.326 +++ loncom/xml/lonxml.pm 2004/07/12 16:25:51 1.328 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.326 2004/07/07 20:43:20 albertel Exp $ +# $Id: lonxml.pm,v 1.328 2004/07/12 16:25:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -389,6 +389,7 @@ sub latex_special_symbols { } else { $string=~s/\\/\\ensuremath{\\backslash}/g; $string=~s/([^\\]|^)\%/$1\\\%/g; + $string=~s/\b_{2,}\b/ \\makebox\[1 cm\]\[b\]{\\hrulefill}/g; $string=~s/([^\\]|^)(\$|_)/$1\\$2/g; $string=~s/\$\$/\$\\\$/g; $string=~s/\#\#/\#\\\#/g; @@ -787,18 +788,26 @@ sub default_homework_load { } } +my $metamode_was; sub startredirection { - $Apache::lonxml::redirection++; - push (@Apache::lonxml::outputstack, ''); + if (!$Apache::lonxml::redirection) { + $metamode_was=$Apache::lonxml::metamode; + } + $Apache::lonxml::metamode=0; + $Apache::lonxml::redirection++; + push (@Apache::lonxml::outputstack, ''); } sub endredirection { - if (!$Apache::lonxml::redirection) { - &Apache::lonxml::error("Endredirection was called, before a startredirection, perhaps you have unbalanced tags. Some debuging information:".join ":",caller); - return ''; - } - $Apache::lonxml::redirection--; - pop @Apache::lonxml::outputstack; + if (!$Apache::lonxml::redirection) { + &Apache::lonxml::error("Endredirection was called, before a startredirection, perhaps you have unbalanced tags. Some debuging information:".join ":",caller); + return ''; + } + $Apache::lonxml::redirection--; + if (!$Apache::lonxml::redirection) { + $Apache::lonxml::metamode=$metamode_was; + } + pop @Apache::lonxml::outputstack; } sub end_tag { @@ -1334,6 +1343,7 @@ sub debug { my $request=$Apache::lonxml::request; if (!$request) { $request=Apache->request; } $request->print('
DEBUG:'.&HTML::Entities::encode($_[0],'<>&"')."
\n"); +# &Apache::lonnet::logthis($_[0]); } }