import { describe, expect, it } from 'vitest' import { renderHighlightedCodeBlock } from '@/components/hermes/chat/highlight' describe('highlight safety', () => { it('escapes large unknown code content', () => { const html = renderHighlightedCodeBlock(''.repeat(100), 'unknown', 'Copy') expect(html).toContain('<img') expect(html).not.toContain(' { const html = renderHighlightedCodeBlock('', 'xml', 'Copy') expect(html).not.toContain('', 'Copy') expect(html).toContain('<script>alert(1)</script>') expect(html).not.toContain('