MCPcopy
hub / github.com/alibaba/page-agent / escapeHtml

Function escapeHtml

packages/website/src/components/HighlightSyntax.tsx:28–30  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

26
27// 辅助函数:转义 HTML 特殊字符
28function escapeHtml(text: string): string {
29 return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
30}
31
32// 语法高亮函数,先提取 token 再转义和高亮
33function highlightSyntax(code: string): string {

Callers 1

highlightSyntaxFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected