MCPcopy Index your code
hub / github.com/coder/code-server / escapeHtml

Function escapeHtml

src/node/util.ts:484–491  ·  view source on GitHub ↗
(unsafe: string)

Source from the content-addressed store, hash-verified

482 * Source: https://stackoverflow.com/a/6234804/3015595
483 **/
484export function escapeHtml(unsafe: string): string {
485 return unsafe
486 .replace(/&/g, "&")
487 .replace(/</g, "&lt;")
488 .replace(/>/g, "&gt;")
489 .replace(/"/g, "&quot;")
490 .replace(/'/g, "&apos;")
491}
492
493/**
494 * A helper function which returns a boolean indicating whether

Callers 3

replaceTemplatesFunction · 0.90
getRootFunction · 0.90
errorHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected