Skip to content
Launch GitLab Knowledge Graph

Add code syntax highlighting for AI responses

Implement syntax highlighting for code blocks in AI chat responses.

Requirements

  • Use Prism.js or highlight.js
  • Auto-detect language
  • Support 20+ languages (Python, JS, Java, Go, Rust, etc.)
  • Copy code button
  • Line numbers
  • Dark/light theme support