MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestToTextStripsEntities

Function TestToTextStripsEntities

internal/htmlutil/htmlutil_test.go:39–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestToTextStripsEntities(t *testing.T) {
40 got := ToText("& < >")
41 if !strings.Contains(got, "& < >") {
42 t.Errorf("ToText entities = %q, should decode HTML entities", got)
43 }
44}
45
46func TestToTextStripsScript(t *testing.T) {
47 got := ToText("<p>hello</p><script>alert('xss')</script>")

Callers

nothing calls this directly

Calls 1

ToTextFunction · 0.85

Tested by

no test coverage detected