Code blocks use syntax highlighting
Why it matters
Code is one of the highest-value outputs of an AI chat product, and unstyled code is close to useless: variable names, keywords, and strings blur together, indentation collapses when copied, and language cues disappear. Developer-facing AI tools lose the entire code-review, debug, and learning use case without syntax highlighting. A monospace font alone is not enough; colorized tokens are what make code visually scannable and differentiate the product from a plain text box.
Severity rationale
High because unhighlighted code materially degrades every developer-facing use case of the product.
Remediation
Install react-syntax-highlighter (or shiki for SSR-friendly highlighting) and wire it into your markdown component at src/components/chat/MessageBubble.tsx via the components prop on ReactMarkdown, passing the detected language through to the highlighter.
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
<ReactMarkdown components={{
code({ className, children }) {
const lang = className?.replace('language-', '');
return <SyntaxHighlighter language={lang}>{children}</SyntaxHighlighter>;
}
}}>{content}</ReactMarkdown>
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Chat Visibility Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-chat-visibility·automated