@@ -2,7 +2,7 @@ import { Button, Anchor, Stack, Group, Box, createStyles } from "@mantine/core";
22import React , { useEffect , useMemo , useState } from "react" ;
33import ReactMarkdown from "react-markdown" ;
44import rehypeRaw from "rehype-raw" ;
5- import { Highlight , themes } from "prism-react-renderer" ;
5+ import { Highlight , themes , Prism } from "prism-react-renderer" ;
66import CodeButtons from "./CodeButtons" ;
77import Step from "./Step" ;
88import LanguageCorner from "./LanguageCorner" ;
@@ -14,7 +14,10 @@ import { fromMarkdown } from "mdast-util-from-markdown";
1414import { visit } from "unist-util-visit" ;
1515import ChatMark from "@/views/components/ChatMark" ;
1616import { useSetState } from "@mantine/hooks" ;
17- import { Trans , useTranslation } from "react-i18next" ;
17+ import { useTranslation } from "react-i18next" ;
18+
19+ ( typeof global !== "undefined" ? global : window ) . Prism = Prism ;
20+ require ( "prismjs/components/prism-java" ) ;
1821
1922const useStyles = createStyles ( ( theme ) => ( {
2023 link : {
@@ -228,7 +231,7 @@ Generate a professionally written and formatted release note in markdown with th
228231 "Devchat key is missing from your environment or settings"
229232 )
230233 ) {
231- if ( process . env . platform === "vscode" ) {
234+ if ( process . env . platform === "vscode" ) {
232235 return t ( "devchat.setkey_vscode" ) ;
233236 }
234237 return t ( "devchat.setkey" ) ;
@@ -307,6 +310,7 @@ Generate a professionally written and formatted release note in markdown with th
307310 const match = / l a n g u a g e - ( \w + ) / . exec ( className || "" ) ;
308311 const value = String ( children ) . replace ( / \n $ / , "" ) ;
309312 let lanugage = match && match [ 1 ] ;
313+
310314 if ( ! lanugage ) {
311315 lanugage = "plaintext" ;
312316 }
0 commit comments