MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / escapeHtml

Function escapeHtml

src/cm/lsp/tooltipExtensions.ts:261–276  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

259}
260
261function escapeHtml(value: string): string {
262 return value.replace(/[&<>"']/g, (match) => {
263 switch (match) {
264 case "&":
265 return "&amp;";
266 case "<":
267 return "&lt;";
268 case ">":
269 return "&gt;";
270 case '"':
271 return "&quot;";
272 default:
273 return "&#39;";
274 }
275 });
276}
277
278function renderCode(plugin: LSPPlugin, code: MarkedString): string {
279 const client = plugin.client as typeof plugin.client & LspClientInternals;

Callers 1

renderCodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected