(t *testing.T)
| 37 | } |
| 38 | |
| 39 | func 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 | |
| 46 | func TestToTextStripsScript(t *testing.T) { |
| 47 | got := ToText("<p>hello</p><script>alert('xss')</script>") |