Skip to content

Commit c503f6f

Browse files
committed
Render markdown for problems in code editor mode
1 parent 96c5ad4 commit c503f6f

3 files changed

Lines changed: 16 additions & 41 deletions

File tree

bun.lock

Lines changed: 12 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/code-editor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
ResizableHandle,
3131
} from "@/components/ui/resizable";
3232
import { mockProblems, Problem } from "@/app/[orgId]/problems/mockProblems";
33+
import Markdown from "react-markdown";
3334

3435
const themes = {
3536
"VS Code Dark": vscodeDark,
@@ -54,7 +55,7 @@ const defaultCode = {
5455
using namespace std;
5556
5657
int main() {
57-
58+
5859
}`,
5960
};
6061

@@ -370,7 +371,7 @@ export function CodeEditor({ problem }: CodeEditorProps) {
370371
{problem?.title}
371372
</h1>
372373
<p className="text-sm text-foreground">
373-
{problem?.description}
374+
<Markdown>{problem?.description}</Markdown>
374375
</p>
375376
</div>
376377
</div>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"react-dnd-html5-backend": "^16.0.1",
9292
"react-dom": "^18",
9393
"react-hook-form": "^7.53.2",
94+
"react-markdown": "^10.1.0",
9495
"react-resizable-panels": "^2.1.7",
9596
"react-syntax-highlighter": "^15.5.0",
9697
"recharts": "^2.14.1",

0 commit comments

Comments
 (0)