MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / escapeXml

Function escapeXml

common/src/util/skills.ts:6–13  ·  view source on GitHub ↗

* Escapes special XML characters in a string.

(str: string)

Source from the content-addressed store, hash-verified

4 * Escapes special XML characters in a string.
5 */
6function escapeXml(str: string): string {
7 return str
8 .replace(/&/g, '&')
9 .replace(/</g, '&lt;')
10 .replace(/>/g, '&gt;')
11 .replace(/"/g, '&quot;')
12 .replace(/'/g, '&apos;')
13}
14
15/**
16 * Formats available skills as XML for inclusion in tool descriptions.

Callers 1

formatAvailableSkillsXmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected