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

Function htmlEscape

aitc/aitc.ts:149–160  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

147 this.set(CONFIG_KEYS.PROMPT_MAP, JSON.stringify(map));
148 }
149}
150
151const decodeHtmlEntities = (text: string): string =>
152 text
153 .replace(/&#(\d+);/g, (_match, code) => {
154 const value = Number.parseInt(code, 10);
155 return Number.isFinite(value) ? String.fromCodePoint(value) : _match;
156 })
157 .replace(/&#x([0-9a-f]+);/gi, (_match, code) => {
158 const value = Number.parseInt(code, 16);
159 return Number.isFinite(value) ? String.fromCodePoint(value) : _match;
160 })
161 .replace(/&(amp|lt|gt|quot|apos|nbsp);/gi, (match, entity) => {
162 switch (entity.toLowerCase()) {
163 case "amp":

Callers 1

handleAitcCommandFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected