Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: register kotlin in ui CodeBlock component

Greg Richardson6b4d0e2dbedf
diff --git a/packages/ui/src/components/CodeBlock/CodeBlock.tsx b/packages/ui/src/components/CodeBlock/CodeBlock.tsx
index 61887e80acc..6c735470069 100644
--- a/packages/ui/src/components/CodeBlock/CodeBlock.tsx
+++ b/packages/ui/src/components/CodeBlock/CodeBlock.tsx
@@ -13,13 +13,14 @@ import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql'
import bash from 'react-syntax-highlighter/dist/cjs/languages/hljs/bash'
import dart from 'react-syntax-highlighter/dist/cjs/languages/hljs/dart'
import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json'
+import kotlin from 'react-syntax-highlighter/dist/cjs/languages/hljs/kotlin'
import { useState } from 'react'
import { useTheme } from 'common/Providers'
export interface CodeBlockProps {
title?: string
- language: 'js' | 'jsx' | 'sql' | 'py' | 'bash' | 'ts' | 'dart' | 'json' | 'csharp'
+ language: 'js' | 'jsx' | 'sql' | 'py' | 'bash' | 'ts' | 'dart' | 'json' | 'csharp' | 'kotlin'
linesToHighlight?: number[]
hideCopy?: boolean
hideLineNumbers?: boolean
@@ -74,6 +75,7 @@ export const CodeBlock = ({
SyntaxHighlighter.registerLanguage('dart', dart)
SyntaxHighlighter.registerLanguage('csharp', csharp)
SyntaxHighlighter.registerLanguage('json', json)
+ SyntaxHighlighter.registerLanguage('kotlin', kotlin)
const large = false
// don't show line numbers if bash == lang