@@ -10,9 +10,7 @@ import { createPortal } from 'react-dom'
10
10
import clsx from 'clsx'
11
11
import { m } from 'framer-motion'
12
12
import { atom , useAtomValue } from 'jotai'
13
- import Markdown from 'markdown-to-jsx'
14
13
import type { CommentModel } from '@mx-space/api-client'
15
- import type { MarkdownToJSX } from 'markdown-to-jsx'
16
14
import type { PropsWithChildren } from 'react'
17
15
18
16
import { Avatar } from '~/components/ui/avatar'
@@ -25,6 +23,7 @@ import { softSpringPreset } from '~/constants/spring'
25
23
import { jotaiStore } from '~/lib/store'
26
24
27
25
import styles from './Comment.module.css'
26
+ import { CommentMarkdown } from './CommentMarkdown'
28
27
import { CommentPinButton , OcticonGistSecret } from './CommentPinButton'
29
28
import { CommentReplyButton } from './CommentReplyButton'
30
29
@@ -150,15 +149,7 @@ export const Comment: Component<{
150
149
'max-w-[calc(100%-3rem)]' ,
151
150
) }
152
151
>
153
- < Markdown
154
- options = { {
155
- disabledTypes,
156
- disableParsingRawHTML : true ,
157
- forceBlock : true ,
158
- } }
159
- >
160
- { text }
161
- </ Markdown >
152
+ < CommentMarkdown > { text } </ CommentMarkdown >
162
153
< CommentReplyButton commentId = { comment . id } />
163
154
</ div >
164
155
</ div >
@@ -200,14 +191,3 @@ export const CommentBoxHolderPortal = (props: PropsWithChildren) => {
200
191
201
192
return createPortal ( props . children , portalElement )
202
193
}
203
-
204
- const disabledTypes = [
205
- 'footnote' ,
206
- 'footnoteReference' ,
207
-
208
- 'image' ,
209
-
210
- 'htmlComment' ,
211
- 'htmlSelfClosing' ,
212
- 'htmlBlock' ,
213
- ] as MarkdownToJSX . RuleName [ ]
0 commit comments