def safe_json(value):
 return json.dumps(value).replace('</', '<\\/')

def safe_json ( value ) : return json . dumps ( value ) . replace ( '</' , '<\\/' )
dump a string to json in a manner that can be used for js strings in mako templates .