MCPcopy Create free account
hub / github.com/auth0/auth0-cli / xmlEscape

Function xmlEscape

internal/cli/quickstarts.go:1634–1643  ·  view source on GitHub ↗

xmlEscape replaces XML/HTML special characters with their entity equivalents so that generated XML config files are well-formed even when values contain characters like &, <, >, " or '.

(s string)

Source from the content-addressed store, hash-verified

1632// so that generated XML config files are well-formed even when values contain
1633// characters like &, <, >, " or '.
1634func xmlEscape(s string) string {
1635 replacer := strings.NewReplacer(
1636 "&", "&amp;",
1637 "<", "&lt;",
1638 ">", "&gt;",
1639 `"`, "&quot;",
1640 "'", "&#39;",
1641 )
1642 return replacer.Replace(s)
1643}
1644
1645func sortedKeys(m map[string]string) []string {
1646 keys := make([]string, 0, len(m))

Callers 1

WriteQuickstartConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected