--- loncom/xml/lonxml.pm 2013/12/03 16:39:47 1.545 +++ loncom/xml/lonxml.pm 2014/06/21 20:56:40 1.547 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.545 2013/12/03 16:39:47 bisitz Exp $ +# $Id: lonxml.pm,v 1.547 2014/06/21 20:56:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -306,8 +306,12 @@ sub xmlparse { &clean_safespace($safeeval); if (@script_var_displays) { - my $scriptoutput = join('',@script_var_displays); - $finaloutput=~s{(\s*)\s*$}{$scriptoutput$1}s; + if ($finaloutput =~ m{\s*\s*$}s) { + my $scriptoutput = join('',@script_var_displays); + $finaloutput=~s{(\s*)\s*$}{$scriptoutput$1}s; + } else { + $finaloutput .= join('',@script_var_displays); + } undef(@script_var_displays); } &init_state(); @@ -1359,7 +1363,9 @@ sub do_registered_ssi { sub add_script_result { my ($display) = @_; - push(@script_var_displays, $display); + if ($display ne '') { + push(@script_var_displays, $display); + } } # @@ -1569,7 +1575,11 @@ FULLPAGE $add_to_onresize = "resize_textarea('$textarea_id','LC_aftertextarea');"; if ($filetype eq 'html') { - $xml_help=&Apache::loncommon::helpLatexCheatsheet(); + my $not_author; + if ($uri =~ m{^/uploaded/}) { + $not_author = 1; + } + $xml_help=&Apache::loncommon::helpLatexCheatsheet(undef,undef,$not_author); } my $titledisplay=&display_title(); @@ -1593,6 +1603,10 @@ FULLPAGE } } } + my $undo; + unless ($uri =~ m{^/uploaded/}) { + $undo = ''."\n"; + } my $editfooter=(< @@ -1606,8 +1620,7 @@ $initialize
- - $htmlerror $deps_button $dragmath_button + $undo $htmlerror $deps_button $dragmath_button