--- loncom/xml/londefdef.pm 2005/11/03 21:58:11 1.292 +++ loncom/xml/londefdef.pm 2005/11/08 02:04:23 1.293 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.292 2005/11/03 21:58:11 albertel Exp $ +# $Id: londefdef.pm,v 1.293 2005/11/08 02:04:23 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -110,8 +110,8 @@ sub start_m { # detect simple math mode entry exits, and convert them # to use \ensuremath if ($currentstring=~/^\s*\$[^\$].*[^\$]\$\s*$/) { - $currentstring=~s/^\$//; - $currentstring=~s/\$$//; + $currentstring=~s/^(\s*)\$/$1/; + $currentstring=~s/\$(\s*)$/$1/; $currentstring='\ensuremath{'.$currentstring.'}'; } $Apache::lonxml::post_evaluate=0;