MCPcopy Create free account
hub / github.com/ShipSecAI/studio / sanitizeHTML

Function sanitizeHTML

frontend/src/components/ui/markdown.tsx:229–232  ·  view source on GitHub ↗

* Sanitizes HTML content to prevent XSS attacks. * * @param html - Raw HTML string from markdown rendering * @returns Sanitized HTML safe for dangerouslySetInnerHTML

(html: string)

Source from the content-addressed store, hash-verified

227 * @returns Sanitized HTML safe for dangerouslySetInnerHTML
228 */
229function sanitizeHTML(html: string): string {
230 // Use .toString() to ensure we return a string even if Trusted Types are enabled
231 return DOMPurify.sanitize(html, DOMPURIFY_CONFIG).toString();
232}
233
234// Initialize markdown-it with plugins (similar to n8n sticky notes)
235const md = new MarkdownIt({

Callers 1

markdown.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected