htmlEscape is a tiny subset of html.EscapeString — sufficient for the four characters that can break a blockquote. Avoids pulling in html/template for one function.
(s string)
| 284 | // the four characters that can break a blockquote. Avoids pulling in |
| 285 | // html/template for one function. |
| 286 | func htmlEscape(s string) string { |
| 287 | if !strings.ContainsAny(s, "&<>\"") { |
| 288 | return s |
| 289 | } |
| 290 | return strings.NewReplacer("&", "&", "<", "<", ">", ">", "\"", """).Replace(s) |
| 291 | } |
no outgoing calls
no test coverage detected