--- loncom/xml/londefdef.pm 2017/01/27 19:58:21 1.464 +++ loncom/xml/londefdef.pm 2023/03/15 16:47:59 1.467 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.464 2017/01/27 19:58:21 damieng Exp $ +# $Id: londefdef.pm,v 1.467 2023/03/15 16:47:59 raeburn Exp $ # # # Copyright Michigan State University Board of Trustees @@ -98,7 +98,19 @@ sub start_m { # On top of that, MathJax will render math without $, but # it will fail with tth. This is worth a warning. # (even though some people might just use latex for printing) - &Apache::lonxml::warning(&mt("Missing \$ in <m>.")); + &Apache::lonxml::warning(&mt('Missing $ in [_1].','<m>')); + } elsif (($env{'browser.type'} eq 'safari') && ($env{'form.editxmltext'}) && + (($env{'form.problemmode'} eq 'view') || ($env{'form.problemmode'} eq 'discard'))) { + my $delimiter; + if ($inside =~ /\$$/) { + $delimiter = '$'; + } elsif ($inside =~ /\\([)\]])$/) { + $delimiter = $1; + } + if ($delimiter) { + &Apache::lonxml::warning(&mt('Insert a space between [_1] and [_2].', + $delimiter,'</m>')); + } } my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); if ($eval eq 'on') { @@ -355,7 +367,7 @@ sub start_title { $Apache::londefdef::title = &Apache::lonxml::get_all_text('/title',$parser,$style); } elsif ($target eq 'tex') { - $currentstring .= '\keephidden{Title of the document: ' + $currentstring .= '\keephidden{Title of the document: '; } if ($target eq 'meta') { $currentstring='';