--- loncom/xml/lonxml.pm 2016/02/20 00:12:45 1.555 +++ loncom/xml/lonxml.pm 2017/02/16 18:17:53 1.557 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.555 2016/02/20 00:12:45 raeburn Exp $ +# $Id: lonxml.pm,v 1.557 2017/02/16 18:17:53 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -345,9 +345,9 @@ sub latex_special_symbols { } else { $string=~s/\\/\\ensuremath{\\backslash}/g; $string=~s/\\\%|\%/\\\%/g; - $string=~s/\\{|{/\\{/g; + $string=~s/\\\{|\{/\\{/g; $string=~s/\\}|}/\\}/g; - $string=~s/\\ensuremath\\{\\backslash\\}/\\ensuremath{\\backslash}/g; + $string=~s/\\ensuremath\\\{\\backslash\\}/\\ensuremath{\\backslash}/g; $string=~s/\\\$|\$/\\\$/g; $string=~s/\\\_|\_/\\\_/g; $string=~s/([^\\]|^)(\~|\^)/$1\\$2\\strut /g; @@ -991,7 +991,7 @@ sub decreasedepth { sub get_id { my ($parstack,$safeeval)=@_; my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($env{'request.state'} eq 'construct' && $id =~ /([._]|[^\w\d\s[:punct:]])/) { + if ($env{'request.state'} eq 'construct' && $id =~ /([._]|[^\w\s\-])/) { &error(&mt('ID [_1] contains invalid characters. IDs are only allowed to contain letters, numbers, spaces and -','"'.$id.'"')); } if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; }