Skip to content

Commit 911cb0d

Browse files
authored
Merge pull request #108 from PytorchConnectomics/render-markdown-tables
render chatbot markdown tables correctly
2 parents 684cc9f + fa0c321 commit 911cb0d

3 files changed

Lines changed: 297 additions & 0 deletions

File tree

client/package-lock.json

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

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"react-markdown": "^10.1.0",
2323
"react-router-dom": "^6.23.1",
2424
"react-scripts": "^5.0.1",
25+
"remark-gfm": "^4.0.1",
2526
"utif": "^3.1.0",
2627
"web-vitals": "^4.1.1"
2728
},

client/src/components/Chatbot.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Button, Input, List, Typography, Space, Spin, Popconfirm } from "antd";
33
import { SendOutlined, CloseOutlined, DeleteOutlined } from "@ant-design/icons";
44
import { queryChatBot, clearChat } from "../api";
55
import ReactMarkdown from "react-markdown";
6+
import remarkGfm from "remark-gfm";
67

78
const { TextArea } = Input;
89
const { Text } = Typography;
@@ -155,6 +156,7 @@ function Chatbot({ onClose }) {
155156
<Text style={{ color: "white" }}>{message.text}</Text>
156157
) : (
157158
<ReactMarkdown
159+
remarkPlugins={[remarkGfm]}
158160
components={{
159161
ul: ({ children }) => (
160162
<ul style={{ paddingLeft: "20px", margin: "8px 0" }}>

0 commit comments

Comments
 (0)