MCPcopy Create free account
hub / github.com/angular/dev-infra / escapeHtml

Function escapeHtml

ng-dev/release/notes/context.ts:16–23  ·  view source on GitHub ↗

Escapes HTML special characters in a string.

(str: string)

Source from the content-addressed store, hash-verified

14
15/** Escapes HTML special characters in a string. */
16function escapeHtml(str: string): string {
17 return str
18 .replace(/&/g, '&')
19 .replace(/</g, '&lt;')
20 .replace(/>/g, '&gt;')
21 .replace(/"/g, '&quot;')
22 .replace(/'/g, '&apos;');
23}
24
25/** List of types to be included in the release notes. */
26const typesToIncludeInReleaseNotes = Object.values(COMMIT_TYPES)

Callers 1

_categorizeCommitsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected