def escapejs(value):
 for (bad, good) in _js_escapes:
  value = mark_safe(force_unicode(value).replace(bad, good))
 return value

def escapejs ( value ) : for ( bad , good ) in _js_escapes : value = mark_safe ( force_unicode ( value ) . replace ( bad , good ) ) return value
hex encodes characters for use in javascript strings .