--- loncom/localize/lonlocal.pm 2014/12/11 01:47:25 1.65 +++ loncom/localize/lonlocal.pm 2015/06/09 21:23:15 1.66 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Localization routines # -# $Id: lonlocal.pm,v 1.65 2014/12/11 01:47:25 raeburn Exp $ +# $Id: lonlocal.pm,v 1.66 2015/06/09 21:23:15 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -171,7 +171,7 @@ use DateTime::Locale; require Exporter; our @ISA = qw (Exporter); -our @EXPORT = qw(mt mtn ns mt_user); +our @EXPORT = qw(mt mtn ns mt_user js_escape html_escape); my %mtcache=(); @@ -575,6 +575,79 @@ sub mt_escape { $$str_ref =~s/([\[\]])/~$1/g; } +=pod + +=item * js_escape + +js_escape takes a string, string reference or hash reference, +and escapes the values so that they can be used within a