MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / escapeHtml

Method escapeHtml

src/lib/FancyError.ts:27–31  ·  view source on GitHub ↗

* Escape HTML entities to prevent XSS

(text: string)

Source from the content-addressed store, hash-verified

25 * Escape HTML entities to prevent XSS
26 */
27 private static escapeHtml (text: string): string {
28 const div = document.createElement('div');
29 div.textContent = text;
30 return div.innerHTML;
31 }
32
33 /**
34 * Generate the modal HTML for an error

Callers 1

generateModalHtmlMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected