def escape_all(v, linkify_only_full=False):
 if isinstance(v, basestring):
  v = jinja2.escape(force_text(v))
  v = linkify_with_outgoing(v, only_full=linkify_only_full)
  return v
 elif isinstance(v, list):
  for (i, lv) in enumerate(v):
   v[i] = escape_all(lv, linkify_only_full=linkify_only_full)
 elif isinstance(v, dict):
  for (k, lv) in v.iteritems():
   v[k] = escape_all(lv, linkify_only_full=linkify_only_full)
 elif isinstance(v, Translation):
  v = jinja2.escape(force_text(v))
 return v

def escape_all ( v , linkify_only_full = False ) : if isinstance ( v , basestring ) : v = jinja2 . escape ( force_text ( v ) ) v = linkify_with_outgoing ( v , only_full = linkify_only_full ) return v elif isinstance ( v , list ) : for ( i , lv ) in enumerate ( v ) : v [ i ] = escape_all ( lv , linkify_only_full = linkify_only_full ) elif isinstance ( v , dict ) : for ( k , lv ) in v . iteritems ( ) : v [ k ] = escape_all ( lv , linkify_only_full = linkify_only_full ) elif isinstance ( v , Translation ) : v = jinja2 . escape ( force_text ( v ) ) return v
escape html in json value .