--- loncom/xml/lonxml.pm 2011/11/21 21:45:36 1.524 +++ loncom/xml/lonxml.pm 2011/12/09 21:21:43 1.527 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.524 2011/11/21 21:45:36 www Exp $ +# $Id: lonxml.pm,v 1.527 2011/12/09 21:21:43 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -301,7 +301,8 @@ sub xmlparse { &clean_safespace($safeeval); if (@script_var_displays) { - $finaloutput .= join('',@script_var_displays); + my $scriptoutput = join('',@script_var_displays); + $finaloutput=~s{(\s*)\s*$}{$scriptoutput$1}s; undef(@script_var_displays); } &init_state(); @@ -1496,7 +1497,8 @@ sub renderingoptions { {&Apache::lonlocal::texthash ('' => '', 'tth' => 'tth (TeX to HTML)', - 'jsMath' => 'jsMath', + 'MathJax' => 'MathJax', + 'jsMath' => 'jsMath', 'mimetex' => 'mimetex (Convert to Images)')}). ''; return $output; @@ -2049,11 +2051,13 @@ sub register_insert_xml { while (my $token = $parser->get_token()) { if ($token->[0] eq 'S') { my $key; - if ($token->[1] eq 'tag') { + if ($token->[1] eq 'tag') { $tag = $token->[2]{'name'}; - $insertlist{$tagnum.'.tag'} = $tag; - $insertlist{$tag.'.num'} = $tagnum; - push(@alltags,$tag); + if (defined($tag)) { + $insertlist{$tagnum.'.tag'} = $tag; + $insertlist{$tag.'.num'} = $tagnum; + push(@alltags,$tag); + } } elsif ($in_help && $token->[1] eq 'file') { $key = $tag.'.helpfile'; } elsif ($in_help && $token->[1] eq 'description') {