MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / htmlEsc

Function htmlEsc

fbi/fbi.ts:27–34  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

25const CACHE_LIMIT_DEF = 300; // default max groups to cache
26const CACHE_LIMIT_MIN = 10;
27const CACHE_LIMIT_MAX = 1000;
28
29const htmlEsc = (s: string) =>
30 s.replace(/[&<>"']/g, (m) => {
31 if (m === "&") return "&amp;";
32 if (m === "<") return "&lt;";
33 if (m === ">") return "&gt;";
34 if (m === '"') return "&quot;";
35 return "&#x27;";
36 });
37

Callers 4

onCmdMethod · 0.85
doCsMethod · 0.85
onMsgMethod · 0.85
doDsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected