MCPcopy
hub / github.com/github/awesome-copilot / escapeHtml

Function escapeHtml

extensions/backlog-swipe-triage/extension.mjs:75–83  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

73}
74
75function escapeHtml(value) {
76 return normalizeText(value).replace(/[&<>"']/g, (char) => {
77 if (char === "&") return "&amp;";
78 if (char === "<") return "&lt;";
79 if (char === ">") return "&gt;";
80 if (char === '"') return "&quot;";
81 return "&#39;";
82 });
83}
84
85function normalizeStringArray(values) {
86 if (!Array.isArray(values)) {

Callers 1

renderHtmlFunction · 0.70

Calls 1

normalizeTextFunction · 0.70

Tested by

no test coverage detected