MCPcopy Create free account
hub / github.com/continuedev/continue / escapeForSVG

Function escapeForSVG

core/util/text.ts:29–39  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

27}
28
29export function escapeForSVG(text: string): string {
30 return text
31 .replace(/&/g, "&") // must be first
32 .replace(/</g, "&lt;")
33 .replace(/>/g, "&gt;")
34 .replace(/"/g, "&quot;")
35 .replace(/'/g, "&apos;")
36 .replace(/\n/g, "\\n") // newlines
37 .replace(/\t/g, "\\t") // tabs
38 .replace(/\r/g, "\\r"); // carriage returns
39}
40
41export function kebabOfStr(str: string): string {
42 return str

Callers 2

text.vitest.tsFile · 0.90

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected