MCPcopy Create free account
hub / github.com/go-json-experiment/json / ExampleEscapeForHTML

Function ExampleEscapeForHTML

jsontext/example_test.go:105–130  ·  view source on GitHub ↗

Directly embedding JSON within HTML requires special handling for safety. Escape certain runes to prevent JSON directly treated as HTML from being able to perform injection. This example shows how to obtain equivalent behavior provided by the v1 [encoding/json] package that is no longer di

()

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 4

MarshalFunction · 0.92
EscapeForHTMLFunction · 0.92
EscapeForJSFunction · 0.92
MultilineFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…