MCPcopy Create free account
hub / github.com/block/buzz / escapeHtml

Function escapeHtml

desktop/src/shared/lib/codeBlockClipboard.ts:3–9  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1const BUZZ_CODE_BLOCK_ATTRIBUTE = "data-buzz-code-block";
2
3function escapeHtml(value: string) {
4 return value
5 .replace(/&/g, "&")
6 .replace(/</g, "&lt;")
7 .replace(/>/g, "&gt;")
8 .replace(/"/g, "&quot;");
9}
10
11function createBuzzCodeBlockHtml(code: string) {
12 // Keep the code as one text node; the paste reader recovers it via textContent.

Callers 1

createBuzzCodeBlockHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected