@@ -30,6 +30,7 @@ import { authAtom } from '../../../store/auth'
30
30
import { formatError } from '../../../utils/error'
31
31
import { formatDateTime } from '../../../utils/times'
32
32
import { wrapErrorMessage } from '../../../utils/wrapErrorMessage'
33
+ import { Markdown } from '../../Markdown'
33
34
import { OutlinedIcon } from '../../OutlinedIcon'
34
35
import { withSuspensable } from '../../Suspensable'
35
36
import { CommentForm } from './CommentForm'
@@ -143,7 +144,7 @@ const MainComment = ({
143
144
comment : MainCommentInfo
144
145
children ?: ReactNode
145
146
} ) => {
146
- const { message , uploader, uploadTime } = comment
147
+ const { uploader, uploadTime } = comment
147
148
148
149
return (
149
150
< Card className = { clsx ( className ) } >
@@ -152,7 +153,7 @@ const MainComment = ({
152
153
< div className = "font-bold mr-2" > { uploader } </ div >
153
154
< div > { formatDateTime ( uploadTime ) } </ div >
154
155
</ div >
155
- < div className = "text-base" > { message } </ div >
156
+ < CommentContent comment = { comment } / >
156
157
< CommentActions comment = { comment } />
157
158
</ div >
158
159
{ children }
@@ -169,7 +170,7 @@ const SubComment = ({
169
170
comment : SubCommentInfo
170
171
fromComment ?: SubCommentInfo
171
172
} ) => {
172
- const { message , uploader, uploadTime } = comment
173
+ const { uploader, uploadTime } = comment
173
174
174
175
return (
175
176
< div className = { clsx ( className , 'pl-8' ) } >
@@ -190,7 +191,7 @@ const SubComment = ({
190
191
:
191
192
</ >
192
193
) }
193
- < span > { message } </ span >
194
+ < CommentContent comment = { comment } / >
194
195
</ div >
195
196
< CommentActions comment = { comment } />
196
197
</ div >
@@ -199,6 +200,16 @@ const SubComment = ({
199
200
)
200
201
}
201
202
203
+ const CommentContent = ( {
204
+ className,
205
+ comment : { message } ,
206
+ } : {
207
+ className ?: string
208
+ comment : CommentInfo
209
+ } ) => {
210
+ return < Markdown className = { clsx ( className ) } > { message } </ Markdown >
211
+ }
212
+
202
213
const CommentActions = ( {
203
214
className,
204
215
comment,
0 commit comments