MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / escapeHtmlAttribute

Function escapeHtmlAttribute

packages/studio/src/utils/sourcePatcher.ts:15–21  ·  view source on GitHub ↗

Escape a string for safe use inside a double-quoted HTML attribute.

(value: string)

Source from the content-addressed store, hash-verified

13
14/** Escape a string for safe use inside a double-quoted HTML attribute. */
15function escapeHtmlAttribute(value: string): string {
16 return value
17 .replace(/&/g, "&")
18 .replace(/"/g, """)
19 .replace(/</g, "&lt;")
20 .replace(/>/g, "&gt;");
21}
22
23/** Reverse escapeHtmlAttribute so callers get the original value. */
24function unescapeHtmlAttribute(value: string): string {

Callers 3

patchAttributeByTargetFunction · 0.85
patchAttributeFunction · 0.85
patchHtmlAttributeInTagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected