MCPcopy
hub / github.com/codeaashu/claude-code / escapeXml

Function escapeXml

src/utils/xml.ts:6–8  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

4 * user input, external data) go inside `<tag>${here}</tag>`.
5 */
6export function escapeXml(s: string): string {
7 return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
8}
9
10/**
11 * Escape for interpolation into a double- or single-quoted attribute value:

Callers 7

escapeXmlAttrFunction · 0.85
ansiToSvgFunction · 0.85
processBashCommandFunction · 0.85
onDoneFunction · 0.85
appendStdoutFunction · 0.85
startStallWatchdogFunction · 0.85
enqueueShellNotificationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected