MCPcopy
hub / github.com/21st-dev/1code / escapeHtml

Function escapeHtml

src/renderer/components/chat-markdown-renderer.tsx:24–29  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

22
23// Escape HTML special characters for safe rendering
24function escapeHtml(text: string): string {
25 return text
26 .replace(/&/g, "&")
27 .replace(/</g, "&lt;")
28 .replace(/>/g, "&gt;")
29}
30
31// Code block text sizes matching paragraph text sizes
32const codeBlockTextSize = {

Callers 1

CodeBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected