MCPcopy Index your code
hub / github.com/Acode-Foundation/Acode / escapeHtml

Function escapeHtml

src/utils/codeHighlight.js:18–24  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

16}
17
18function escapeHtml(text) {
19 return text
20 .replace(/&/g, "&")
21 .replace(/</g, "&lt;")
22 .replace(/>/g, "&gt;")
23 .replace(/"/g, "&quot;");
24}
25
26function escapeRegExp(string) {
27 return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

Callers 2

highlightLineFunction · 0.70
highlightCodeBlockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected