MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / unescapeHtmlEntities

Function unescapeHtmlEntities

src/utils/text-normalization.ts:85–99  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

83 * @returns The unescaped string with HTML entities converted to their literal characters
84 */
85export function unescapeHtmlEntities(text: string): string {
86 if (!text) return text
87
88 return text
89 .replace(/&lt;/g, "<")
90 .replace(/&gt;/g, ">")
91 .replace(/&quot;/g, '"')
92 .replace(/&#39;/g, "'")
93 .replace(/&apos;/g, "'")
94 .replace(/&#91;/g, "[")
95 .replace(/&#93;/g, "]")
96 .replace(/&lsqb;/g, "[")
97 .replace(/&rsqb;/g, "]")
98 .replace(/&amp;/g, "&")
99}

Callers 5

executeMethod · 0.90
executeMethod · 0.90
executeMethod · 0.90

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected