def jssafe(text=u''):
 if (text.__class__ != unicode):
  text = _force_unicode(text)
 return _Unsafe(text.translate(_js_escapes))

def jssafe ( text = u'' ) : if ( text . __class__ != unicode ) : text = _force_unicode ( text ) return _Unsafe ( text . translate ( _js_escapes ) )
prevents text from breaking outside of string literals in js .