MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / htmlEscape

Function htmlEscape

internal/outbound/forward.go:286–291  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

284// the four characters that can break a blockquote. Avoids pulling in
285// html/template for one function.
286func htmlEscape(s string) string {
287 if !strings.ContainsAny(s, "&<>\"") {
288 return s
289 }
290 return strings.NewReplacer("&", "&amp;", "<", "&lt;", ">", "&gt;", "\"", "&quot;").Replace(s)
291}

Callers 2

BuildForwardHTMLBodyFunction · 0.85
writeHTMLHeaderLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected