diff --git a/Frontend/src/app/components/mdx.tsx b/Frontend/src/app/components/mdx.tsx index 937b7c5..8294411 100644 --- a/Frontend/src/app/components/mdx.tsx +++ b/Frontend/src/app/components/mdx.tsx @@ -18,6 +18,7 @@ import { solarizedDark, stackoverflowDark, } from "react-syntax-highlighter/dist/esm/styles/hljs"; +import { capitalize } from "@/lib/stringUtils"; /** * The MDX components to style. @@ -77,17 +78,28 @@ const components: any = { className: string; children: any; }): ReactElement => { - return className ? ( - - {children} - + const language: string | undefined = className?.replace( + "language-", + "" + ); // The language of the code, if any + return language ? ( +
+ + {children} + + + {/* Language Icon */} +
+ {capitalize(language)} +
+
) : ( - + {children} );