MCPcopy Create free account
hub / github.com/danvk/webdiff / escapeHtml

Function escapeHtml

ts/codediff/DiffRow.tsx:18–25  ·  view source on GitHub ↗
(unsafe: string)

Source from the content-addressed store, hash-verified

16}
17
18function escapeHtml(unsafe: string) {
19 return unsafe
20 .replaceAll('&', '&')
21 .replaceAll('<', '&lt;')
22 .replaceAll('>', '&gt;')
23 .replaceAll('"', '&quot;')
24 .replaceAll("'", '&#039;');
25}
26
27const makeCodeTd = (type: string, text: string | undefined, html: string | undefined) => {
28 if (text === undefined) {

Callers 1

makeCodeTdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected