Skip to content

Commit c4665a6

Browse files
committed
feat: integrate remark-gfm for enhanced Markdown rendering in MessageDetail component
Entire-Checkpoint: 749f162dddd9
1 parent c6e6fee commit c4665a6

3 files changed

Lines changed: 300 additions & 4 deletions

File tree

package-lock.json

Lines changed: 295 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"react-dom": "^19.0.0",
3030
"react-icons": "^5.6.0",
3131
"react-markdown": "^10.1.0",
32-
"react-syntax-highlighter": "^16.1.1"
32+
"react-syntax-highlighter": "^16.1.1",
33+
"remark-gfm": "^4.0.1"
3334
},
3435
"devDependencies": {
3536
"@tauri-apps/cli": "^2",

src/components/MessageDetail.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState, useCallback, useRef, useLayoutEffect, useEffect } from "react";
22
import ReactMarkdown from "react-markdown";
3+
import remarkGfm from "remark-gfm";
34
import type { DisplayMessage, DisplayItem } from "../types";
45
import { shortModel, formatTokens, formatDuration, formatExactTime } from "../lib/format";
56
import { getModelColor, getTeamColor } from "../lib/theme";
@@ -346,7 +347,7 @@ export function MessageDetail({
346347
<div className="message-detail__content">
347348
{msg.content && (
348349
<div className="message-detail__text">
349-
<ReactMarkdown>{msg.content}</ReactMarkdown>
350+
<ReactMarkdown remarkPlugins={[remarkGfm]}>{msg.content}</ReactMarkdown>
350351
</div>
351352
)}
352353
{hasItems && (
@@ -719,7 +720,7 @@ function AgentDetailColumn({
719720
<div className="message-detail__content">
720721
{msg.content && (
721722
<div className="message-detail__text">
722-
<ReactMarkdown>{msg.content}</ReactMarkdown>
723+
<ReactMarkdown remarkPlugins={[remarkGfm]}>{msg.content}</ReactMarkdown>
723724
</div>
724725
)}
725726
{hasItems && (

0 commit comments

Comments
 (0)