parameters: (self, *args, **kwargs)
return_statement: return _ScriptSafe(json_.dumps(*args, **kwargs))
docstring: JSON used as JS in HTML (script tags) is problematic: <script>
          tags are a special context which only waits for </script> but doesn't
          interpret anything else, this means standard htmlescaping does not
          work (it breaks double quotes, and e.g. `<` will become `&lt;` *in
          the resulting JSON/JS* not just inside the page).
  
          However, failing to escape embedded json means the json strings could
          contains `</script>` and thus become XSS vector.
  
          The solution turns out to be very simple: use JSON-level unicode
          escapes for HTML-unsafe characters (e.g. "<" -> "\u003C". This removes
          the XSS issue without breaking the json, and there is no difference to
          the end result once it's been parsed back from JSON. So it will work
          properly even for HTML attributes or raw text.
  
          Also handle U+2028 and U+2029 the same way just in case as these are
          interpreted as newlines in javascript but not in JSON, which could
          lead to oddities and issues.
  
          .. warning::
  
              except inside <script> elements, this should be escaped following
              the normal rules of the containing format
  
          Cf https://code.djangoproject.com/ticket/17419#comment:27
docstring_summary: JSON used as JS in HTML (script tags) is problematic: <script>
          tags are a special context which only waits for </script> but doesn't
          interpret anything else, this means standard htmlescaping does not
          work (it breaks double quotes, and e.g. `<` will become `&lt;` *in
          the resulting JSON/JS* not just inside the page).
docstring_tokens: JSON used as JS in HTML ( script tags ) is problematic : <script > tags are a special context which only waits for < / script > but doesn t interpret anything else this means standard htmlescaping does not work ( it breaks double quotes and e . g . < will become &lt ; * in the resulting JSON / JS * not just inside the page ) .
function: def dumps(self, *args, **kwargs):
          """ JSON used as JS in HTML (script tags) is problematic: <script>
          tags are a special context which only waits for </script> but doesn't
          interpret anything else, this means standard htmlescaping does not
          work (it breaks double quotes, and e.g. `<` will become `&lt;` *in
          the resulting JSON/JS* not just inside the page).
  
          However, failing to escape embedded json means the json strings could
          contains `</script>` and thus become XSS vector.
  
          The solution turns out to be very simple: use JSON-level unicode
          escapes for HTML-unsafe characters (e.g. "<" -> "\u003C". This removes
          the XSS issue without breaking the json, and there is no difference to
          the end result once it's been parsed back from JSON. So it will work
          properly even for HTML attributes or raw text.
  
          Also handle U+2028 and U+2029 the same way just in case as these are
          interpreted as newlines in javascript but not in JSON, which could
          lead to oddities and issues.
  
          .. warning::
  
              except inside <script> elements, this should be escaped following
              the normal rules of the containing format
  
          Cf https://code.djangoproject.com/ticket/17419#comment:27
          """
          return _ScriptSafe(json_.dumps(*args, **kwargs))
function_tokens: def dumps ( self , * args , * * kwargs ) : return _ScriptSafe ( json_ . dumps ( * args , * * kwargs ) )