class_docstr: An encoder that produces JSON safe to embed in HTML.
  
  To embed JSON content in, say, a script tag on a web page, the
  characters &, < and > should be escaped. They cannot be escaped
  with the usual entities (e.g. &amp;) because they are not expanded
  within <script> tags.
  
  This class also escapes the line separator and paragraph separator
  characters U+2028 and U+2029, irrespective of the ensure_ascii setting,
  as these characters are not valid in JavaScript strings (see
  http://timelessrepo.com/json-isnt-a-javascript-subset).
class_docstr_tok: ["An","encoder","that","produces","JSON","safe","to","embed","in","HTML",".","To","embed","JSON","content","in",",","say",",","a","script","tag","on","a","web","page",",","the","characters","&",",","<","and",">","should","be","escaped",".","They","can","not","be","escaped","with","the","usual","entities","(","e.g",".","&","amp",";",")","because","they","are","not","expanded","within","<","script",">","tags",".","This","class","also","escapes","the","line","separator","and","paragraph","separator","characters","U+2028","and","U+2029",",","irrespective","of","the","ensure_ascii","setting",",","as","these","characters","are","not","valid","in","JavaScript","strings","(","see","http",":","\/\/timelessrepo.com\/json-isnt-a-javascript-subset",")","."]
code: def iterencode(self, o, _one_shot=False):
      chunks = super(JSONEncoderForHTML, self).iterencode(o, _one_shot)
      for chunk in chunks:
          chunk = chunk.replace("&", "\\u0026")
          chunk = chunk.replace("<", "\\u003c")
          chunk = chunk.replace(">", "\\u003e")
  
          if not self.ensure_ascii:
              chunk = chunk.replace("\u2028", "\\u2028")
              chunk = chunk.replace("\u2029", "\\u2029")
  
          yield chunk
  
imports: from __future__ import absolute_import
  import re
  from operator import itemgetter
  import decimal
  from .compat import unichr, binary_type, text_type, string_types, integer_types, PY3
  from .decoder import PosInf
  from .raw_json import RawJSON
label_desc: Use image node_id 2 for calling the JSONEncoderForHTML obj's underlying member method code with example usage: obj.iterencode(o, _one_shot) without return types