MCPcopy Create free account
hub / github.com/pquerna/ffjson / SetEscapeHTML

Method SetEscapeHTML

ffjson/encoder.go:44–46  ·  view source on GitHub ↗

SetEscapeHTML specifies whether problematic HTML characters should be escaped inside JSON quoted strings. The default behavior is to escape &, <, and > to \u0026, \u003c, and \u003e to avoid certain safety problems that can arise when embedding JSON in HTML. In non-HTML settings where the escaping

(on bool)

Source from the content-addressed store, hash-verified

42// In non-HTML settings where the escaping interferes with the readability
43// of the output, SetEscapeHTML(false) disables this behavior.
44func (enc *Encoder) SetEscapeHTML(on bool) {
45 enc.enc.SetEscapeHTML(on)
46}
47
48// NewEncoder returns a reusable Encoder.
49// Output will be written to the supplied writer.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected