From 33ca81937ad07c0d87a0fd71a3b84e698d4bc0bb Mon Sep 17 00:00:00 2001
From: KW86022 <184099420+KW86022@users.noreply.github.com>
Date: Tue, 22 Oct 2024 15:00:02 +0000
Subject: [PATCH 1/2] github markdown model card details code highlighting
---
frontend/src/common/MarkdownDisplay.tsx | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/frontend/src/common/MarkdownDisplay.tsx b/frontend/src/common/MarkdownDisplay.tsx
index 9aa237987..db5094baa 100644
--- a/frontend/src/common/MarkdownDisplay.tsx
+++ b/frontend/src/common/MarkdownDisplay.tsx
@@ -6,6 +6,7 @@ import { useTheme } from '@mui/material/styles'
import Typography from '@mui/material/Typography'
import ReactMarkdown from 'markdown-to-jsx'
import { useMemo } from 'react'
+import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
export type MarkdownDisplayProps = {
children: string
@@ -99,6 +100,24 @@ export default function MarkdownDisplay({ children }: MarkdownDisplayProps) {
/>
),
},
+ code: {
+ component: ({ children, ...props }: any) => {
+ const language = props.className ? props.className.replace('lang-', '') : ''
+
+ return (
+